MDL-80591 phpunit: Coding style cleanup both CLI scripts

While the init.php was cleaned up not long ago, let's
re-review it (small detail only) and proceed to, also,
clean up the util.php one.

Note that both will raise an error about missing MOODLE_INTERNAL
check, but that's expected, they are CLI scripts, independent
from Moodle's bootstrap, so they don't have config.php required
either.
This commit is contained in:
Eloy Lafuente (stronk7)
2024-01-13 18:46:45 +01:00
parent 5f31b37e1d
commit 9f10626533
2 changed files with 26 additions and 26 deletions
+6 -9
View File
@@ -1,5 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -12,18 +12,18 @@
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* All in one init script - PHP version.
*
* @package tool_phpunit
* @copyright 2012 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (isset($_SERVER['REMOTE_ADDR'])) {
die; // no access from web!
die; // No access from web!
}
// Force OPcache reset if used, we do not want any stale caches
@@ -99,10 +99,7 @@ if ($code != 0) {
chdir(__DIR__);
$output = null;
exec("php util.php --diag", $output, $code);
if ($code == 0) {
// everything is ready
} else if ($code == PHPUNIT_EXITCODE_INSTALL) {
if ($code == PHPUNIT_EXITCODE_INSTALL) {
passthru("php util.php --install", $code);
if ($code != 0) {
exit($code);
@@ -115,7 +112,7 @@ if ($code == 0) {
exit($code);
}
} else {
} else if ($code != 0) {
echo implode("\n", $output)."\n";
exit($code);
}