TriadDiagnosticsScanner
Diagnoses the Action/View/Template triad convention (Actions/{Action}Action.php <-> Views/{Action}{ViewName}View.php <-> Templates/{Action}{ViewName}.php) for every action ModuleActionDiscovery finds, independent of whether the action is ever actually routed to.
Three checks, each only attempted once the prior one succeeds (a missing action class means there is nothing to reflect a view name from, etc.):
MISSING_ACTION_CLASS: theActions/*Action.phpfile does not define the class its own path/namespace convention implies. -MISSING_VIEW:getDefaultViewName()names a view with no matching{Action}{ViewName}Viewclass and no legacy view file on disk. -MISSING_TEMPLATE: the view exists, but at least one of itsexecute()/execute{OutputType}()methods (perTriadViewResolver::executeMethodsFor()) has no matching template file for the extension its output type renders with (perTriadViewResolver::templateExtensionFor()— the app’s real renderer configuration when aControlleris supplied,.phpotherwise). Convention-only, not a bug: it can only false-flag as missing, never hide a real gap, so it stays a warning. A method whose declared return type proves it always returns non-null content is skipped automatically (TriadViewResolver::alwaysReturnsContent()— perActionExecutor::renderView(), a non-null return is the response body and the template/layer path is never reached, however the method body itself got there, e.g. via a shared base class’ssetupHtml()/loadLayout()). Whatever that can’t prove (untyped or nullable return,mixed,void) falls back to an explicit opt-out via@quiote-viewmethod-has-no-templatein the method’s own docblock —TriadViewResolver::declaresNoTemplate().
getDefaultViewName() is read via newInstanceWithoutConstructor() (TriadViewResolver) so no constructor/DI side effects run; an action whose base classes make even this unsafe (an uncatchable fatal, not a Throwable) is simply the one gap this scanner cannot see — no diagnostic is produced for that action, but no false one either.
Synopsis
Section titled “Synopsis”final class TriadDiagnosticsScanner
| Since | 1.0.0 |
| Source | Routing/Compiler/TriadDiagnosticsScanner.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(TriadViewResolver $views = new TriadViewResolver(…), ?Controller $controller = null): mixed
| Parameter | Type | Description |
|---|---|---|
$views | TriadViewResolver | |
$controller | ?Controller |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
scan(list<ModuleActionEntry> $entries): list<Diagnostic> |
scan()
Section titled “scan()”public function scan(list<ModuleActionEntry> $entries): list<Diagnostic>
| Parameter | Type | Description |
|---|---|---|
$entries | list``<ModuleActionEntry> |
Returns list``<Diagnostic>