| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class ValidateCommand extends Command |
||
| 15 | { |
||
| 16 | use TracksExecutionTime; |
||
| 17 | |||
| 18 | /** @var string */ |
||
| 19 | protected $signature = 'validate'; |
||
| 20 | |||
| 21 | /** @var string */ |
||
| 22 | protected $description = 'Run a series of tests to validate your setup and help you optimize your site.'; |
||
| 23 | |||
| 24 | protected ValidationService $service; |
||
| 25 | |||
| 26 | public function __construct() |
||
| 31 | } |
||
| 32 | |||
| 33 | public function handle(): int |
||
| 34 | { |
||
| 35 | $this->startClock(); |
||
| 36 | |||
| 37 | $this->info('Running validation tests!'); |
||
| 38 | |||
| 39 | $this->newLine(); |
||
| 40 | |||
| 41 | foreach (ValidationService::checks() as $check) { |
||
| 42 | $this->runCheck($check); |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->info("All done! {$this->timeTotal()}"); |
||
| 46 | |||
| 47 | return Command::SUCCESS; |
||
| 48 | } |
||
| 49 | |||
| 50 | protected function runCheck(string $check): void |
||
| 58 | } |
||
| 59 | |||
| 60 | protected function getCheckTime(float $timeStart): string |
||
| 61 | { |
||
| 62 | return number_format((microtime(true) - $timeStart) * 1000, 2); |
||
| 63 | } |
||
| 64 | |||
| 65 | protected function timeTotal(): string |
||
| 69 | ); |
||
| 70 | } |
||
| 72 |