<?php

namespace App\SiteReadiness\Checks;

use App\SiteReadiness\CheckResult;
use App\SiteReadiness\ReadinessCheck;
use App\SiteReadiness\Status;

class AppDebugCheck implements ReadinessCheck
{
    public function group(): string { return 'Environment'; }
    public function label(): string { return 'Debug mode is off'; }
    public function hint(): string { return 'Set APP_DEBUG=false in .env for production.'; }

    public function run(): CheckResult
    {
        if (!config('app.debug')) {
            return new CheckResult(Status::OK, 'APP_DEBUG is false.');
        }
        $prod = config('app.env') === 'production';
        return new CheckResult($prod ? Status::FAIL : Status::WARN, 'APP_DEBUG is true.');
    }
}
