Merge branch '3.0' into 3

This commit is contained in:
github-actions 2024-06-19 23:45:36 +00:00
commit 913390ec91
3 changed files with 14 additions and 11 deletions

View File

@ -80,7 +80,7 @@ class FileAccessibilityAndValidationCheck implements EnvironmentCheck
{
$this->path = $path;
$this->fileTypeValidateFunc = ($fileTypeValidateFunc)? $fileTypeValidateFunc : 'noVidation';
$this->checkType = ($checkType) ? $checkType : self::CHECK_SINGLE;
$this->checkType = ($checkType) ? $checkType : FileAccessibilityAndValidationCheck::CHECK_SINGLE;
}
/**
@ -109,7 +109,9 @@ class FileAccessibilityAndValidationCheck implements EnvironmentCheck
}
// If at least one file was valid, count as passed
if ($this->checkType == self::CHECK_SINGLE && count($invalidFiles ?? []) < count($files ?? [])) {
if ($this->checkType == FileAccessibilityAndValidationCheck::CHECK_SINGLE
&& count($invalidFiles ?? []) < count($files ?? [])
) {
$validFileList = PHP_EOL;
foreach ($validFiles as $vf) {
$validFileList .= $vf . PHP_EOL;

View File

@ -85,7 +85,7 @@ class FileAgeCheck implements EnvironmentCheck
$this->path = $path;
$this->relativeAge = $relativeAge;
$this->checkFn = $checkFn;
$this->checkType = ($checkType) ? $checkType : self::CHECK_SINGLE;
$this->checkType = ($checkType) ? $checkType : FileAgeCheck::CHECK_SINGLE;
$this->compareOperand = $compareOperand;
}
@ -110,7 +110,7 @@ class FileAgeCheck implements EnvironmentCheck
$validFiles[] = $file;
} else {
$invalidFiles[] = $file;
if ($this->checkType == self::CHECK_ALL) {
if ($this->checkType == FileAgeCheck::CHECK_ALL) {
return [
EnvironmentCheck::ERROR,
sprintf(
@ -127,7 +127,7 @@ class FileAgeCheck implements EnvironmentCheck
}
// If at least one file was valid, count as passed
if ($this->checkType == self::CHECK_SINGLE && count($invalidFiles ?? []) < count($files ?? [])) {
if ($this->checkType == FileAgeCheck::CHECK_SINGLE && count($invalidFiles ?? []) < count($files ?? [])) {
return [EnvironmentCheck::OK, ''];
}
if (count($invalidFiles ?? []) == 0) {

View File

@ -74,7 +74,8 @@ class EnvironmentCheckSuite
public function __construct($suiteName)
{
if (empty($this->config()->registered_suites[$suiteName])) {
// Not registered via config system, but it still may be configured later via self::register.
// Not registered via config system, but it still may be configured later
// via EnvironmentCheckSuite::register.
return;
}
@ -181,10 +182,10 @@ class EnvironmentCheckSuite
*/
public static function inst($name)
{
if (!isset(self::$instances[$name])) {
self::$instances[$name] = new EnvironmentCheckSuite($name);
if (!isset(EnvironmentCheckSuite::$instances[$name])) {
EnvironmentCheckSuite::$instances[$name] = new EnvironmentCheckSuite($name);
}
return self::$instances[$name];
return EnvironmentCheckSuite::$instances[$name];
}
/**
@ -201,7 +202,7 @@ class EnvironmentCheckSuite
}
foreach ($names as $name) {
self::inst($name)->push($check, $title);
EnvironmentCheckSuite::inst($name)->push($check, $title);
}
}
@ -210,6 +211,6 @@ class EnvironmentCheckSuite
*/
public static function reset()
{
self::$instances = [];
EnvironmentCheckSuite::$instances = [];
}
}