diff --git a/src/Checks/FileAccessibilityAndValidationCheck.php b/src/Checks/FileAccessibilityAndValidationCheck.php index abff14b..6bae00c 100644 --- a/src/Checks/FileAccessibilityAndValidationCheck.php +++ b/src/Checks/FileAccessibilityAndValidationCheck.php @@ -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; diff --git a/src/Checks/FileAgeCheck.php b/src/Checks/FileAgeCheck.php index ff7dea3..5cc8050 100644 --- a/src/Checks/FileAgeCheck.php +++ b/src/Checks/FileAgeCheck.php @@ -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) { diff --git a/src/EnvironmentCheckSuite.php b/src/EnvironmentCheckSuite.php index 3950126..c17f901 100644 --- a/src/EnvironmentCheckSuite.php +++ b/src/EnvironmentCheckSuite.php @@ -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 = []; } }