.claude/skills/phpstan-internals/SKILL.md
Navigate and read PHPStan's internal source code from the phar file
npx skillsauth add mglaman/phpstan-drupal phpstan-internalsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PHPStan is distributed as a phar file. Claude's normal file tools (Read, Grep, Glob) cannot access phar contents. Use the methods below to explore PHPStan's internal APIs when developing rules and type extensions.
vendor/phpstan/phpstan/phpstan.pharphar:///Users/mglaman/Projects/php/phpstan-drupal/vendor/phpstan/phpstan/phpstan.phar/Use the JetBrains MCP get_symbol_info tool to look up PHPStan classes and interfaces. It resolves symbols via PhpStorm's index and returns declarations and documentation.
Find a use statement referencing the PHPStan class in any src/ file, then call get_symbol_info with the fully qualified class name.
When JetBrains MCP is unavailable or you need to browse directories, use PHP CLI commands via Bash.
php -r "echo file_get_contents('phar:///Users/mglaman/Projects/php/phpstan-drupal/vendor/phpstan/phpstan/phpstan.phar/src/Type/DynamicMethodReturnTypeExtension.php');"
php -r "print_r(scandir('phar:///Users/mglaman/Projects/php/phpstan-drupal/vendor/phpstan/phpstan/phpstan.phar/src/Type/'));"
php -r "echo file_get_contents('phar:///Users/mglaman/Projects/php/phpstan-drupal/vendor/phpstan/phpstan/phpstan.phar/src/Type/DynamicMethodReturnTypeExtension.php');" | grep -n 'getTypeFromMethodCall'
php -r "\$dir = 'phar:///Users/mglaman/Projects/php/phpstan-drupal/vendor/phpstan/phpstan/phpstan.phar/src/Type/'; foreach (scandir(\$dir) as \$f) { if (substr(\$f, -4) === '.php') { \$c = file_get_contents(\$dir . \$f); if (strpos(\$c, 'SearchTerm') !== false) echo \$f . PHP_EOL; }}"
| Directory | Contents |
|---|---|
| src/Analyser/ | Scope, NodeScopeResolver, analysis engine |
| src/Type/ | Type system, type extensions interfaces |
| src/Rules/ | Built-in rules, Rule interface |
| src/Reflection/ | ReflectionProvider, class/method/property reflection |
| src/PhpDoc/ | PHPDoc parsing, type resolving |
| src/DependencyInjection/ | Container, extension loading |
| src/Testing/ | RuleTestCase, TypeInferenceTestCase base classes |
| src/Node/ | Virtual nodes (InClassNode, InClassMethodNode, etc.) |
These are the PHPStan interfaces and classes that phpstan-drupal most frequently extends:
PHPStan\Rules\Rule — Custom analysis rulesPHPStan\Type\DynamicMethodReturnTypeExtension — Dynamic return types for method callsPHPStan\Type\DynamicStaticMethodReturnTypeExtension — Dynamic return types for static method callsPHPStan\Type\DynamicFunctionReturnTypeExtension — Dynamic return types for function callsPHPStan\Analyser\Scope — Analysis scope (variable types, context)PHPStan\Reflection\ReflectionProvider — Look up class/function reflectionsPHPStan\Reflection\MethodReflection — Method reflection dataPHPStan\Type\Type — Base type interfacePHPStan\Type\ObjectType — Represents a class instance typePHPStan\Testing\RuleTestCase — Base class for rule teststesting
Generate a PHPStan rule test class and fixture data file
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.