<< All versions
Skill v1.0.0
currentAutomated scan100/100fabd/kanji-koohii/fix-with-phpstan
──Details
PublishedNovember 3, 2026 at 10:39 AM
Content Hashsha256:196649c2e473553f...
Git SHA02cff34dfa08
──Files
Files (1 file, 1.2 KB)
SKILL.md1.2 KBactive
SKILL.md · 35 lines · 1.2 KB
name: fix-with-phpstan description: Fix PHPStan static analysis errors in PHP files. Use this skill whenever the user asks to "fix PHPStan errors", "run PHPStan on", or "clean up types in" one or more PHP files or a module directory. disable-model-invocation: true argument-hint: "[filename.php or path/to/module/]" metadata: version: "1.0.0"
Fix PHPStan errors in the file(s) or directory specified in $ARGUMENTS.
When making changes to a function
- Add types to parameters where you can infer them confidently from call sites
- Add the return type to the signature where possible, e.g.
function foo(): string {} - When a parameter is typed
mixed, look at call sites for a narrower type. If there are multiple plausible options, ask the user.
Fixing "Access to an undefined property" in a Symfony action
Symfony actions set template variables as $this->varName inside action methods, which triggers this PHPStan error. The correct fix is a class PHPDoc declaration:
php
/*** @property string $templateVar*/class aboutActions extends sfActions{public function executeIndex(): void{$this->templateVar = "value";}}