mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
add doctor command
This commit is contained in:
42
src/SPC/doctor/CheckResult.php
Normal file
42
src/SPC/doctor/CheckResult.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\doctor;
|
||||
|
||||
class CheckResult
|
||||
{
|
||||
public function __construct(private string $message = '', private string $fix_item = '', private array $fix_params = [])
|
||||
{
|
||||
}
|
||||
|
||||
public static function fail(string $message, string $fix_item = '', array $fix_params = []): CheckResult
|
||||
{
|
||||
return new static($message, $fix_item, $fix_params);
|
||||
}
|
||||
|
||||
public static function ok(): CheckResult
|
||||
{
|
||||
return new static();
|
||||
}
|
||||
|
||||
public function getMessage(): string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function getFixItem(): string
|
||||
{
|
||||
return $this->fix_item;
|
||||
}
|
||||
|
||||
public function getFixParams(): array
|
||||
{
|
||||
return $this->fix_params;
|
||||
}
|
||||
|
||||
public function isOK(): bool
|
||||
{
|
||||
return empty($this->message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user