Skip to content
docsv0.1.0

ControllerVerifier

Verifies a class follows the Milpa host-app controller convention: extends the host's `Milpa\app\Providers\BaseController`, calls `parent::__construct()`, and every `#[Route]`-attributed method has an uppercase HTTP verb, a leading-slash path, the `(Request $request, array $params = [])` signature, an `HttpResponse` return type, no debug output, and no (verb, path) collision with a sibling method. This convention — the exact FQCNs `Milpa\app\Providers\BaseController` / `HttpResponse` and the `Milpa\Attributes\Route` attribute — belongs to the generated CODE's target, not to this package: `coa:make controller` scaffolds a class that extends those host classes (see the `.stub` templates under `Make/stubs/`), so this verifier closes the loop by checking the scaffolded output against the same convention. Ported 1:1 from the original `scripts/verify-controller.php` (the reflection checks only — the CLI's file-path→FQCN resolution and stdout formatting live in the thin CLI shim instead).

ControllerVerifier::verify()

public function verify(string $fqcn): Milpa\DevTools\Verify\VerificationResult

Reflects `$fqcn` and checks it against the host-app controller convention described above.

Parameters

Parameters of verify()
NameTypeDescription
$fqcnstring