Skip to content

Rule overview

ID Severity Category Framework What it finds
WS001 High Static state any A static property that is written at runtime.
WS002 High Global state any global $x, writes to $GLOBALS, writes to request superglobals.
WS003 Medium Environment mutation any putenv(), ini_set(), writes to $_ENV / $_SERVER.
WS004 Medium Singleton any The self-instantiating singleton pattern, graded by whether the instance is mutable.
WS005 High Container binding Laravel A class bound with singleton() that carries mutable state.
WS006 Medium Container binding Laravel A singleton() binding that is a candidate for scoped() — a lifetime change to review, not a rename.
WS007 High Static state any Static state whose name or type reads as request-specific ($currentUser, static ?User $u).
WS008 Medium Memory retention any A static collection that only ever grows.
WS009 Medium Event registration any Listener, macro or handler registration on a request path.
WS010 Low Process lifecycle any Code that assumes the process dies at the end of the request.

The Severity column is each rule’s default. Most rules compute a severity per finding — a static property with an explicit reset path is reported lower than one without, and an immutable singleton much lower than a mutable one — and the configuration can override the result.

Inspect the rule set from the CLI:

Terminal window
vendor/bin/worker-safety rules # the table above
vendor/bin/worker-safety rules WS001 # one rule in detail
vendor/bin/worker-safety rules --format=json