mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +08:00
add doctor command
This commit is contained in:
23
src/SPC/doctor/item/OSCheckList.php
Normal file
23
src/SPC/doctor/item/OSCheckList.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\doctor\item;
|
||||
|
||||
use SPC\builder\traits\UnixSystemUtilTrait;
|
||||
use SPC\doctor\AsCheckItem;
|
||||
use SPC\doctor\CheckResult;
|
||||
|
||||
class OSCheckList
|
||||
{
|
||||
use UnixSystemUtilTrait;
|
||||
|
||||
#[AsCheckItem('if current os are supported', level: 999)]
|
||||
public function checkOS(): ?CheckResult
|
||||
{
|
||||
if (!in_array(PHP_OS_FAMILY, ['Darwin', 'Linux'])) {
|
||||
return CheckResult::fail('Current OS is not supported');
|
||||
}
|
||||
return CheckResult::ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user