From 45f3c49854a00e87c2f1b6ae7a3acf9db39a51c9 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 11 Dec 2017 15:39:34 -0500 Subject: [PATCH] Apply php-cs-fixer to config and public directories. --- config/application.config.php | 28 ++++++++++++++-------------- config/autoload/global.php | 14 +++++++------- public/index.php | 6 ++---- tests/vufind.php_cs | 5 ++++- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/config/application.config.php b/config/application.config.php index 53de51f118e..4c4a5e3b401 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -1,9 +1,9 @@ <?php // Set up modules: -$modules = array( +$modules = [ 'ZfcRbac', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin', 'VuFindApi' -); +]; if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) { $modules[] = 'VuFindConsole'; } @@ -53,24 +53,24 @@ if (!is_dir($cacheDir)) { $useCache = APPLICATION_ENV != 'development' && !defined('VUFIND_PHPUNIT_RUNNING'); // Build configuration: -return array( +return [ 'modules' => array_unique($modules), - 'module_listener_options' => array( - 'config_glob_paths' => array( + 'module_listener_options' => [ + 'config_glob_paths' => [ 'config/autoload/{,*.}{global,local}.php', - ), + ], 'config_cache_enabled' => $useCache, 'module_map_cache_enabled' => $useCache, 'check_dependencies' => (APPLICATION_ENV == 'development'), 'cache_dir' => $cacheDir, - 'module_paths' => array( + 'module_paths' => [ './module', './vendor', - ), - ), - 'service_manager' => array( + ], + ], + 'service_manager' => [ 'use_defaults' => true, - 'factories' => array( - ), - ), -); + 'factories' => [ + ], + ], +]; diff --git a/config/autoload/global.php b/config/autoload/global.php index b03c0c4f9b7..5ce1434a778 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -2,15 +2,15 @@ /** * Global Configuration Override * - * You can use this file for overridding configuration values from modules, etc. - * You would place values in here that are agnostic to the environment and not - * sensitive to security. + * You can use this file for overridding configuration values from modules, etc. + * You would place values in here that are agnostic to the environment and not + * sensitive to security. * - * @NOTE: In practice, this file will typically be INCLUDED in your source - * control, so do not include passwords or other sensitive information in this + * @NOTE: In practice, this file will typically be INCLUDED in your source + * control, so do not include passwords or other sensitive information in this * file. */ -return array( +return [ // ... -); +]; diff --git a/public/index.php b/public/index.php index 6967aaf957a..5282d0e679d 100644 --- a/public/index.php +++ b/public/index.php @@ -1,14 +1,12 @@ <?php use Zend\Loader\AutoloaderFactory; -use Zend\ServiceManager\ServiceManager; -use Zend\Mvc\Service\ServiceManagerConfig; // If the XHProf profiler is enabled, set it up now: $xhprof = getenv('VUFIND_PROFILER_XHPROF'); if (!empty($xhprof)) { if (extension_loaded('xhprof')) { xhprof_enable(); - } else if (extension_loaded('tideways')) { + } elseif (extension_loaded('tideways')) { tideways_enable(); } else { $xhprof = false; @@ -57,7 +55,7 @@ chdir(APPLICATION_PATH); // Ensure vendor/ is on include_path; some PEAR components may not load correctly // otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling // from the shared PEAR directory instead of the local copy): -$pathParts = array(); +$pathParts = []; $pathParts[] = APPLICATION_PATH . '/vendor'; $pathParts[] = get_include_path(); set_include_path(implode(PATH_SEPARATOR, $pathParts)); diff --git a/tests/vufind.php_cs b/tests/vufind.php_cs index aff0b9e402c..a5f7e3f6975 100644 --- a/tests/vufind.php_cs +++ b/tests/vufind.php_cs @@ -1,6 +1,9 @@ <?php -$finder = PhpCsFixer\Finder::create()->in(__DIR__ . '/../module'); +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__ . '/../config') + ->in(__DIR__ . '/../module') + ->in(__DIR__ . '/../public'); $rules = [ 'align_multiline_comment' => true, -- GitLab