| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\CheckInterface; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class ApcFragmentation implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(int $warningThreshold, int $criticalThreshold, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasApcFragmentation($warningThreshold, $criticalThreshold); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\CheckInterface; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class ApcMemory implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(int $warningThreshold, int $criticalThreshold, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasApcMemory($warningThreshold, $criticalThreshold); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\ClassExists as LaminasClassExists; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class ClassExists implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $name, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasClassExists($name); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\DiskUsage as LaminasDiskUsage; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class DiskUsage implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(int $warningThreshold, int $criticalThreshold, string $path = '/', string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasDiskUsage($warningThreshold, $criticalThreshold, $path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\IniFile as LaminasIniFile; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class IniFile implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasIniFile($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\JsonFile as LaminasJsonFile; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class JsonFile implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasJsonFile($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\OpCacheMemory as LaminasOpCacheMemory; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class OpCacheMemory implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(int $warningThreshold, int $criticalThreshold, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasOpCacheMemory($warningThreshold, $criticalThreshold); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\ExtensionLoaded; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class PhpExtension implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $extensionName, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new ExtensionLoaded($extensionName); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\DirReadable; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class ReadableDirectory implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new DirReadable($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\SecurityAdvisory as LaminasSecurityAdvisory; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class SecurityAdvisory implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasSecurityAdvisory($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\StreamWrapperExists as LaminasStreamWrapperExists; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class StreamWrapperExists implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $name, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasStreamWrapperExists($name); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\DirWritable; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class WritableDirectory implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new DirWritable($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\XmlFile as LaminasXmlFile; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class XmlFile implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasXmlFile($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 11-40 (lines=30) @@ | ||
| 8 | use Laminas\Diagnostics\Check\YamlFile as LaminasYamlFile; |
|
| 9 | use Laminas\Diagnostics\Result\ResultInterface; |
|
| 10 | ||
| 11 | class YamlFile implements CheckInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @var CheckInterface |
|
| 15 | */ |
|
| 16 | private $check; |
|
| 17 | ||
| 18 | public function __construct(string $path, string $label = null) |
|
| 19 | { |
|
| 20 | $check = new LaminasYamlFile($path); |
|
| 21 | $check->setLabel($label); |
|
| 22 | ||
| 23 | $this->check = $check; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function check(): ResultInterface |
|
| 27 | { |
|
| 28 | return $this->check->check(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getLabel(): string |
|
| 32 | { |
|
| 33 | return $this->check->getLabel(); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function setLabel(string $label): void |
|
| 37 | { |
|
| 38 | $this->check->setLabel($label); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||