From 73bca12da5973c15a0bae895a7bce6f88f1751d6 Mon Sep 17 00:00:00 2001 From: lmajano Date: Mon, 15 Jul 2024 14:22:32 +0000 Subject: [PATCH] Apply cfformat changes --- system/Bootstrap.cfc | 4 +-- system/FrameworkSupertype.cfc | 2 +- system/async/tasks/ScheduledTask.cfc | 2 +- system/ioc/Injector.cfc | 6 +++- .../modules/HTMLHelper/models/HTMLHelper.cfc | 2 +- system/remote/ColdboxProxy.cfc | 6 +++- system/web/config/ApplicationLoader.cfc | 18 +++++++++-- system/web/routing/Router.cfc | 4 +-- system/web/services/HandlerService.cfc | 11 ++++--- system/web/services/LoaderService.cfc | 6 +++- system/web/services/ModuleService.cfc | 30 +++++++++++++++---- system/web/services/RoutingService.cfc | 12 ++++++-- system/web/services/SchedulerService.cfc | 6 +++- 13 files changed, 84 insertions(+), 25 deletions(-) diff --git a/system/Bootstrap.cfc b/system/Bootstrap.cfc index d908a0d7a..32ad6f12f 100644 --- a/system/Bootstrap.cfc +++ b/system/Bootstrap.cfc @@ -503,7 +503,7 @@ component serializable="false" accessors="true" { // Process A ColdBox Request Only // If the file is "index.(cfm|bxm)" then we will process it - if( reFindNoCase( "index\.(cfm|bxm)", listLast( arguments.targetPage, "/" ) ) ){ + if ( reFindNoCase( "index\.(cfm|bxm)", listLast( arguments.targetPage, "/" ) ) ) { processColdBoxRequest(); } @@ -528,7 +528,7 @@ component serializable="false" accessors="true" { ); // Process it - if( fileExists( cbController.locateFilePath( "index.bxm" ) ) ){ + if ( fileExists( cbController.locateFilePath( "index.bxm" ) ) ) { onRequestStart( "index.bxm" ); } else { onRequestStart( "index.cfm" ); diff --git a/system/FrameworkSupertype.cfc b/system/FrameworkSupertype.cfc index 99233f790..47e697383 100644 --- a/system/FrameworkSupertype.cfc +++ b/system/FrameworkSupertype.cfc @@ -827,7 +827,7 @@ component serializable="false" accessors="true" { else if ( fileExists( UDFRelativePath & ".cfc" ) ) { locatedPath = "/" & appMapping & "/" & udflibrary & ".cfc"; } else if ( fileExists( UDFRelativePath & ".bx" ) ) { - locatedPath = "/" & appMapping & "/" & udflibrary & ".bx"; + locatedPath = "/" & appMapping & "/" & udflibrary & ".bx"; } else if ( fileExists( UDFRelativePath & ".cfm" ) ) { locatedPath = "/" & appMapping & "/" & udflibrary & ".cfm"; } else if ( fileExists( UDFRelativePath & ".bxm" ) ) { diff --git a/system/async/tasks/ScheduledTask.cfc b/system/async/tasks/ScheduledTask.cfc index 5592239d9..c19f1b1d2 100644 --- a/system/async/tasks/ScheduledTask.cfc +++ b/system/async/tasks/ScheduledTask.cfc @@ -767,7 +767,7 @@ component accessors="true" { cleanupTaskRun(); // set next run time based on timeUnit and period // ONLY if we are not forcing the task to run - if( !arguments.force ){ + if ( !arguments.force ) { setNextRunTime(); } } diff --git a/system/ioc/Injector.cfc b/system/ioc/Injector.cfc index 18b0a4e17..3b0bc95ce 100644 --- a/system/ioc/Injector.cfc +++ b/system/ioc/Injector.cfc @@ -784,7 +784,11 @@ component serializable="false" accessors="true" { // Check Scan Locations In Order for ( var thisScanPath in scanLocations ) { // Check if located? If so, return instantiation path - if ( fileExists( scanLocations[ thisScanPath ] & CFCName & ".cfc" ) || fileExists( scanLocations[ thisScanPath ] & CFCName & ".bx" ) ) { + if ( + fileExists( scanLocations[ thisScanPath ] & CFCName & ".cfc" ) || fileExists( + scanLocations[ thisScanPath ] & CFCName & ".bx" + ) + ) { return thisScanPath & "." & arguments.name; } } diff --git a/system/modules/HTMLHelper/models/HTMLHelper.cfc b/system/modules/HTMLHelper/models/HTMLHelper.cfc index 0773a32d4..b5a2e82e1 100755 --- a/system/modules/HTMLHelper/models/HTMLHelper.cfc +++ b/system/modules/HTMLHelper/models/HTMLHelper.cfc @@ -2937,7 +2937,7 @@ component private string function prepareBaseLink( boolean noBaseURL = false, src ){ var baseURL = replaceNoCase( requestService.getContext().getSESbaseURL(), - findNoCase( ".cfm", cgi.script_name ) ? "index.cfm" : "index.bxm", + findNoCase( ".cfm", cgi.script_name ) ? "index.cfm" : "index.bxm", "" ); // return if base is eempty diff --git a/system/remote/ColdboxProxy.cfc b/system/remote/ColdboxProxy.cfc index 303f5b0bc..50f155546 100644 --- a/system/remote/ColdboxProxy.cfc +++ b/system/remote/ColdboxProxy.cfc @@ -364,7 +364,11 @@ component serializable="false" accessors="true" { var scriptName = CGI.SCRIPT_NAME; // Only process this logic if hitting a remote proxy CFC directly and if ColdBox exists. - if ( len( scriptName ) < 5 || !reFindNoCase( "(cfc|bx)", right( scriptName, 4 ) ) || !verifyColdBox( throwOnNotExist = false ) ) { + if ( + len( scriptName ) < 5 || !reFindNoCase( "(cfc|bx)", right( scriptName, 4 ) ) || !verifyColdBox( + throwOnNotExist = false + ) + ) { return; } diff --git a/system/web/config/ApplicationLoader.cfc b/system/web/config/ApplicationLoader.cfc index 59acbe666..93c9d70c8 100644 --- a/system/web/config/ApplicationLoader.cfc +++ b/system/web/config/ApplicationLoader.cfc @@ -576,7 +576,11 @@ component accessors="true" { } } // Check if LogBoxConfig.cfc exists in the config conventions - else if ( fileExists( variables.controller.getAppRootPath() & "config/CacheBox.cfc" ) || fileExists( variables.controller.getAppRootPath() & "config/CacheBox.bx" ) ) { + else if ( + fileExists( variables.controller.getAppRootPath() & "config/CacheBox.cfc" ) || fileExists( + variables.controller.getAppRootPath() & "config/CacheBox.bx" + ) + ) { configStruct.cacheBox.configFile = loadCacheBoxByConvention( configStruct ); } // else, load the default coldbox cachebox config @@ -658,7 +662,11 @@ component accessors="true" { arguments.config[ "LogBoxConfig" ] = logBoxConfig.getMemento(); } // Check if LogBoxConfig.cfc exists in the config conventions and load it. - else if ( fileExists( variables.controller.getAppRootPath() & "config/LogBox.cfc" ) || fileExists( variables.controller.getAppRootPath() & "config/LogBox.bx" ) ) { + else if ( + fileExists( variables.controller.getAppRootPath() & "config/LogBox.cfc" ) || fileExists( + variables.controller.getAppRootPath() & "config/LogBox.bx" + ) + ) { loadLogBoxByConvention( logBoxConfig, arguments.config ); } // Check if hash changed by means of programmatic object config @@ -688,7 +696,11 @@ component accessors="true" { arguments.config.wirebox.binderPath = wireBoxDSL.binder; } // Check if WireBox.cfc exists in the config conventions, if so create binder - else if ( fileExists( variables.controller.getAppRootPath() & "config/WireBox.cfc" ) || fileExists( variables.controller.getAppRootPath() & "config/WireBox.bx" ) ) { + else if ( + fileExists( variables.controller.getAppRootPath() & "config/WireBox.cfc" ) || fileExists( + variables.controller.getAppRootPath() & "config/WireBox.bx" + ) + ) { arguments.config.wirebox.binderPath = "config.WireBox"; if ( len( arguments.config.appMapping ) ) { arguments.config.wirebox.binderPath = arguments.config.appMapping & ".#arguments.config.wirebox.binderPath#"; diff --git a/system/web/routing/Router.cfc b/system/web/routing/Router.cfc index 046596c31..043ffdd43 100644 --- a/system/web/routing/Router.cfc +++ b/system/web/routing/Router.cfc @@ -22,12 +22,12 @@ component ****************************************************************/ property - name ="cachebox" + name ="cachebox" inject ="cachebox" delegate="getCache"; property name ="controller" - inject ="coldbox" + inject ="coldbox" delegate="relocate,runEvent,runRoute"; property name="flash" inject="coldbox:flash"; property name="logBox" inject="logbox"; diff --git a/system/web/services/HandlerService.cfc b/system/web/services/HandlerService.cfc index 458028b77..a223670f6 100644 --- a/system/web/services/HandlerService.cfc +++ b/system/web/services/HandlerService.cfc @@ -412,9 +412,7 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { } // CFML View - if ( - fileExists( expandPath( targetView & ".cfm" ) ) || fileExists( expandPath( targetView & ".bxm" ) ) - ) { + if ( fileExists( expandPath( targetView & ".cfm" ) ) || fileExists( expandPath( targetView & ".bxm" ) ) ) { arguments.ehBean.setViewDispatch( true ); return true; } @@ -595,7 +593,12 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { // Convert windows \ to java / arguments.directory = replace( arguments.directory, "\", "/", "all" ); - return directoryList( arguments.directory, true, "array", "*.cfc|*.bx" ).map( function( item ){ + return directoryList( + arguments.directory, + true, + "array", + "*.cfc|*.bx" + ).map( function( item ){ var thisAbsolutePath = replace( item, "\", "/", "all" ); var cleanHandler = replaceNoCase( thisAbsolutePath, directory, "", "all" ); // Clean OS separators to dot notation. diff --git a/system/web/services/LoaderService.cfc b/system/web/services/LoaderService.cfc index dbde6b879..6470f5818 100644 --- a/system/web/services/LoaderService.cfc +++ b/system/web/services/LoaderService.cfc @@ -295,7 +295,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { coldboxSettings[ "ConfigFileLocationOverride" ] = false; // verify coldbox.cfc exists in convention: /app/config/Coldbox.cfc - if ( fileExists( appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".cfc" ) || fileExists( appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".bx" ) ) { + if ( + fileExists( appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".cfc" ) || fileExists( + appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".bx" + ) + ) { coldboxSettings[ "ConfigFileLocation" ] = configFileLocation; } diff --git a/system/web/services/ModuleService.cfc b/system/web/services/ModuleService.cfc index d207999a5..b09fce9d2 100755 --- a/system/web/services/ModuleService.cfc +++ b/system/web/services/ModuleService.cfc @@ -487,7 +487,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { // cleanup module name var childName = listLast( thisChild, "/\" ); // verify ModuleConfig exists, else skip - if ( fileExists( thisChild & "/ModuleConfig.cfc" ) || fileExists( thisChild & "/ModuleConfig.bx" ) ) { + if ( + fileExists( thisChild & "/ModuleConfig.cfc" ) || fileExists( + thisChild & "/ModuleConfig.bx" + ) + ) { // add to parent children arrayAppend( mConfig.childModules, childname ); // register child @@ -689,7 +693,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { } // Register Default Module Export if it exists as @moduleName, so you can do getInstance( "@moduleName" ) - if ( fileExists( mconfig.modelsPhysicalPath & "/#arguments.moduleName#.cfc" ) || fileExists( mconfig.modelsPhysicalPath & "/#arguments.moduleName#.bx" ) ) { + if ( + fileExists( mconfig.modelsPhysicalPath & "/#arguments.moduleName#.cfc" ) || fileExists( + mconfig.modelsPhysicalPath & "/#arguments.moduleName#.bx" + ) + ) { mConfig.injector .getBinder() .map( [ @@ -752,7 +760,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { ); // config/Router Conventions - if ( fileExists( mConfig.routerPhysicalPath & ".cfc" ) || fileExists( mConfig.routerPhysicalPath & ".bx" ) ) { + if ( + fileExists( mConfig.routerPhysicalPath & ".cfc" ) || fileExists( + mConfig.routerPhysicalPath & ".bx" + ) + ) { // Process as a Router.cfc with virtual inheritance mConfig.injector .registerNewInstance( @@ -823,7 +835,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { | Module Schedulers |-------------------------------------------------------------------------- */ - if ( fileExists( mConfig.schedulerPhysicalPath & ".cfc" ) || fileExists( mConfig.schedulerPhysicalPath & ".bx" ) ) { + if ( + fileExists( mConfig.schedulerPhysicalPath & ".cfc" ) || fileExists( + mConfig.schedulerPhysicalPath & ".bx" + ) + ) { mConfig.scheduler = variables.controller .getSchedulerService() .loadScheduler( @@ -1278,7 +1294,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { mConfig.settings.append( globalModuleSettings[ mConfig.modelNamespace ], true ); // config/{mConfig.modelNamespace}.cfc overrides - if ( fileExists( "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.cfc" ) || fileExists( "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.bx" ) ) { + if ( + fileExists( "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.cfc" ) || fileExists( + "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.bx" + ) + ) { loadModuleSettingsOverride( mConfig, mConfig.modelNamespace ); } } diff --git a/system/web/services/RoutingService.cfc b/system/web/services/RoutingService.cfc index 3d747e79b..33796625c 100644 --- a/system/web/services/RoutingService.cfc +++ b/system/web/services/RoutingService.cfc @@ -84,7 +84,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { // Discover router: app or base var configFilePath = variables.routingAppMapping & modernRouter.replace( ".", "/", "all" ); - var routerType = ( fileExists( expandPath( configFilePath & ".cfc" ) ) || fileExists( expandPath( configFilePath & ".bx" ) ) ) ? "modern" : "base"; + var routerType = ( + fileExists( expandPath( configFilePath & ".cfc" ) ) || fileExists( + expandPath( configFilePath & ".bx" ) + ) + ) ? "modern" : "base"; // Check if base router mapped? if ( NOT wirebox.getBinder().mappingExists( baseRouter ) ) { @@ -996,7 +1000,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { } // Clean up the path_info from index - results[ "pathInfo" ] = reReplaceNoCase( results[ "pathInfo" ], "^[/\\]index\.(cfm|bxm)", "" ); + results[ "pathInfo" ] = reReplaceNoCase( + results[ "pathInfo" ], + "^[/\\]index\.(cfm|bxm)", + "" + ); // Clean the scriptname from the pathinfo if it is the first item in case this is a nested application if ( len( results[ "scriptName" ] ) ) { diff --git a/system/web/services/SchedulerService.cfc b/system/web/services/SchedulerService.cfc index 9ed773793..3c2dcc8b4 100644 --- a/system/web/services/SchedulerService.cfc +++ b/system/web/services/SchedulerService.cfc @@ -72,7 +72,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" { } // Check if the convention exists, else just build out a simple scheduler - if ( fileExists( variables.appPath & "config/Scheduler.cfc" ) || fileExists( variables.appPath & "config/Scheduler.bx" ) ) { + if ( + fileExists( variables.appPath & "config/Scheduler.cfc" ) || fileExists( + variables.appPath & "config/Scheduler.bx" + ) + ) { schedulerPath = ( variables.appMapping.len() ? "#variables.appMapping#.#appSchedulerConvention#" : appSchedulerConvention );