Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tools] Enable PHPCS for populate_visit_windows.php #5995

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions test/run-php-linter.sh
Expand Up @@ -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 $?;

Expand Down
8 changes: 4 additions & 4 deletions tools/populate_visit_windows.php
Expand Up @@ -48,7 +48,7 @@ class VisitWindowPopulator
*/
function __construct()
{
$this->DB = Database::singleton();
$this->DB = Database::singleton();
$this->Config = NDB_Config::singleton();
}

Expand Down Expand Up @@ -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);
}


};
}
}
Expand Down