Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano authored and github-actions[bot] committed Oct 17, 2023
1 parent 46007cd commit a67d3ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
13 changes: 6 additions & 7 deletions system/ioc/Injector.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1503,18 +1503,17 @@ component serializable="false" accessors="true" {
private Injector function registerListeners(){
var aopMixerAdded = false;
for ( var thisListener in variables.binder.getListeners() ) {
if( thisListener.class == "coldbox.system.aop.Mixer" ){
if ( thisListener.class == "coldbox.system.aop.Mixer" ) {
aopMixerAdded = true;
}
registerListener( thisListener );
}
// If we have any aspects defined but no mixer, auto-add it
if( !aopMixerAdded && variables.binder.hasAspects() ){
variables.log.info( "AOP aspects detected but no Mixer listener found, auto-adding it with defaults..." );
registerListener( {
class: "coldbox.system.aop.Mixer",
name: "aopMixer"
} );
if ( !aopMixerAdded && variables.binder.hasAspects() ) {
variables.log.info(
"AOP aspects detected but no Mixer listener found, auto-adding it with defaults..."
);
registerListener( { class : "coldbox.system.aop.Mixer", name : "aopMixer" } );
}
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion system/ioc/config/Binder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ component accessors="true" {
* @return True if we have aspects, false if not
*/
boolean function hasAspects(){
return mappings.some( (key, mapping) => {
return mappings.some( ( key, mapping ) => {
return arguments.mapping.isAspect();
} );
}
Expand Down
10 changes: 4 additions & 6 deletions tests/specs/integration/WireBoxTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ component extends="tests.resources.BaseIntegrationTest" {
/*********************************** BDD SUITES ***********************************/

function run(){


story( "Make AOP mixer auto-load if any aspects are defined", function(){
given( "1 or more aspects defined", function(){
then( "the AOP mixer must load", function(){
var mixer = controller.getInterceptorService().getInterceptionStates();
expect( mixer ).toHaveKey( "afterInstanceAutowire" );
expect( mixer.afterInstanceAutowire.getPool().containsKey( "aopmixer") ).toBeTrue();
});
});
});
expect( mixer.afterInstanceAutowire.getPool().containsKey( "aopmixer" ) ).toBeTrue();
} );
} );
} );

describe( "WireBox custom DSL", function(){
beforeEach( function( currentSpec ){
Expand Down

0 comments on commit a67d3ac

Please sign in to comment.