Static linter for FrankenPHP Worker Mode.
Provide an ultra-fast CLI tool, written in Go, capable of certifying that a PHP application is compatible with the persistent memory model of FrankenPHP, Swoole, or RoadRunner.
Long-term Vision: Submit franken-check as an official tool for the FrankenPHP ecosystem (under php/frankenphp or dunglas organizations), potentially integrated as a sub-command of the main binary (frankenphp check).
To be adopted by the official community, the tool must follow:
- Extreme Performance: Near-instant scan via Go's native multi-threading.
- Zero False Positives: Fine-grained AST analysis to avoid unnecessary alerts (e.g.,
readonlyproperties orResetInterfaceusage). - Actionable Insights: Every error must point to remediation documentation.
- Zero Dependencies: A single static binary, easy to integrate into any CI.
- Language: Go (Golang) 1.21+
- Parser: Tree-sitter (official PHP grammar)
- Concurrency: Goroutines + Worker Pools for multi-threaded scanning.
- Output Formats: Console (Colored), JSON (WIP), SARIF (GitHub Actions).
- Description: Detects object property mutations (
$this->prop = $val) in services/controllers. - Exception:
__constructmethod.- Classes implementing
ResetInterface(requires checking consistency).
- Remediation: Make properties
readonlyor implement state reset.
- Description: Forbids assigning values to static properties (
self::$cache = $val). - Why: Static variables persist for the entire lifetime of the Go/PHP worker.
- Remediation: Use a Cache service (Redis/APC) or configuration parameters.
- Description: Detects usage of
die()andexit(). - Why: Kills the worker prematurely, causing expensive restarts and potential server crashes via FrankenPHP's exponential backoff.
- Remediation: Throw an exception or return a HTTP
Response.
- Description: Flags usage of
globalkeyword or direct access to superglobals. - Remediation: Use the Request object provided by the framework (Symfony/Laravel).