From 1ba3b2558b9e581edf05af815a8e56fb32334a13 Mon Sep 17 00:00:00 2001 From: John Saigle Date: Wed, 29 Jan 2020 15:37:46 -0500 Subject: [PATCH] [Tools] Enable PHPCS for populate_visit_windows.php --- test/run-php-linter.sh | 1 + tools/populate_visit_windows.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/run-php-linter.sh b/test/run-php-linter.sh index 410fad7408c..492f0d5730e 100755 --- a/test/run-php-linter.sh +++ b/test/run-php-linter.sh @@ -13,6 +13,7 @@ find docs modules htdocs php src -name '*.class.inc' -print0 -o -name '*.php' -p # Also run PHPCS on all tools/ scripts in this array declare -a tools_list=( 'assign_missing_instruments.php' + 'populate_visit_windows.php' ) vendor/bin/phpcs --standard=test/LorisCS.xml --extensions=php,inc php/ htdocs/ modules/ "${tools_list[@]/#/tools/}" || exit $?; diff --git a/tools/populate_visit_windows.php b/tools/populate_visit_windows.php index 6467c9f47ba..ee9e5cb0263 100755 --- a/tools/populate_visit_windows.php +++ b/tools/populate_visit_windows.php @@ -48,7 +48,7 @@ class VisitWindowPopulator */ function __construct() { - $this->DB = Database::singleton(); + $this->DB = Database::singleton(); $this->Config = NDB_Config::singleton(); } @@ -83,13 +83,13 @@ function run() // Can't use Utility::getVisits() because that uses the Visit_Window table.. $vls = $this->Config->getSetting("visitLabel"); foreach (Utility::associativeToNumericArray($vls) as $visits) { - foreach (Utility::associativeToNumericArray($visits['labelSet']['item']) as $item) { + foreach (Utility::associativeToNumericArray( + $visits['labelSet']['item'] + ) as $item) { $visit = $item['@']['value']; if (!empty($visit)) { $this->insertIfMissing($visit); } - - }; } }