File has no declare(strict_types=1)
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 2 points from that category, once per scan, no matter how many places it turns up.
What it detects
The file does not declare strict_types, so PHP silently coerces scalar argument and return types instead of throwing a TypeError on a mismatch. This is a style and rigor check, not a bug by itself: plenty of working PHP code omits it, and Blade templates are excluded because the directive has no meaning there.
Why it matters
Without strict_types, PHP coerces mismatched scalar types at call boundaries instead of raising an error, so a function expecting an int silently accepts "5" or true and keeps going with whatever value that coerces to. This is a note about rigor and style, not a bug by itself, and it is common, and fine, for working code to run without it.
How to fix it
Add declare(strict_types=1); as the very first statement in the file, right after the opening <?php tag, and add real type hints to function signatures so the declaration has something to enforce. Roll it out file by file rather than all at once, since a few genuinely relied-upon coercions may need a small rewrite.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo