Snapshot of main at 9f39a6e1e (2026-11-02)
This commit is contained in:
commit
6ccf1792d7
2580 files changed
+1040202
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\PlatformOverrides;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Read-only report on the platform folder: which config is used, whether its public files are served, and
|
||||
* overrides that went stale (translation keys the code no longer has, templates whose original changed).
|
||||
* Exit code 1 when something is broken (e.g. invalid JSON); warnings alone exit 0.
|
||||
*/
|
||||
class PlatformCheck extends Command
|
||||
{
|
||||
protected $signature = 'platform:check';
|
||||
|
||||
protected $description = 'Report on the platform folder and overrides that went stale (read-only)';
|
||||
|
||||
public function handle(PlatformOverrides $overrides): int
|
||||
{
|
||||
$marks = ['ok' => '<info> ✓</info>', 'info' => '<comment> i</comment>', 'warn' => '<comment> !</comment>', 'fail' => '<error> ✗</error>'];
|
||||
$findings = $overrides->check();
|
||||
|
||||
$this->line('Platform folder: ' . platform_path());
|
||||
foreach ($findings as $finding) {
|
||||
$this->line("{$marks[$finding['level']]} {$finding['message']}");
|
||||
}
|
||||
|
||||
$count = fn (string $level) => count(array_filter($findings, fn ($f) => $f['level'] === $level));
|
||||
$this->newLine();
|
||||
$this->line("{$count('warn')} warnings, {$count('fail')} failed");
|
||||
|
||||
return $count('fail') ? self::FAILURE : self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user