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 Apr 22, 2024
1 parent 17da095 commit ca202fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
12 changes: 10 additions & 2 deletions system/CollectionExpectation.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@ component accessors="true" {
function onMissingMethod( string missingMethodName, any missingMethodArguments ){
if ( isArray( variables.actual ) ) {
for ( var e in variables.actual ) {
invoke( variables.spec.expect( e ), arguments.missingMethodName, arguments.missingMethodArguments );
invoke(
variables.spec.expect( e ),
arguments.missingMethodName,
arguments.missingMethodArguments
);
}
} else if ( isStruct( variables.actual ) ) {
for ( var k in variables.actual ) {
var e = variables.actual[ k ];
invoke( variables.spec.expect( e ), arguments.missingMethodName, arguments.missingMethodArguments );
invoke(
variables.spec.expect( e ),
arguments.missingMethodName,
arguments.missingMethodArguments
);
}
} else {
variables.assert.fail( "expectAll() actual is neither array nor struct" );
Expand Down
26 changes: 12 additions & 14 deletions system/MockBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -292,22 +292,20 @@ The Official ColdBox Mocking Factory
/>
<cfargument name="default" required="false" hint="Default value to return if property does not exist"/>
<cfscript>
var thisScope = variables;
if( arguments.scope == "this" ){
thisScope = this;
} else if(
!isNull( variables) && variables.keyExists( arguments.scope )
){
thisScope = variables[ arguments.scope ];
}
var thisScope = variables;
if ( arguments.scope == "this" ) {
thisScope = this;
} else if ( !isNull( variables ) && variables.keyExists( arguments.scope ) ) {
thisScope = variables[ arguments.scope ];
}

if ( structKeyExists( thisScope, arguments.name ) ) {
return thisScope[ arguments.name ];
}
if ( structKeyExists( thisScope, arguments.name ) ) {
return thisScope[ arguments.name ];
}

if ( structKeyExists( arguments, "default" ) ) {
return arguments.default;
}
if ( structKeyExists( arguments, "default" ) ) {
return arguments.default;
}
</cfscript>
<cfthrow
type ="MockBox.PropertyDoesNotExist"
Expand Down
2 changes: 1 addition & 1 deletion system/util/MixerUtil.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ component accessors="true" {
* Removes a method in a CFC
*/
function removePropertyMixin( required propertyName, scope = "variables" ){
if( arguments.scope eq "variables" ){
if ( arguments.scope eq "variables" ) {
structDelete( variables, arguments.propertyName );
} else {
structDelete( this, arguments.propertyName );
Expand Down

0 comments on commit ca202fe

Please sign in to comment.