Enable larastan checkOctaneCompatibility - #34
Open
jakobkollerup wants to merge 1 commit into
Open
Conversation
Turns on larastan's OctaneCompatibilityRule in both the default and strict extension, so container misuse inside service provider bindings is caught at analysis time.
LauJosefsen
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets
checkOctaneCompatibility: trueinextension.neonandextension-strict.neon, enabling larastan'sOctaneCompatibilityRulecompany-wide. Most of our services run Octane; larastan defaults this rule
to
falseand we never overrode it.What it catches
Container misuse inside service provider bindings — the container passed
into a constructor within a
singleton()closure, or$this->appreachedfrom a param-less
bind()/singleton()closure.bind()with an explicit$appparam is exempt, and it does not detect broader Octane state leakssuch as static caches on long-lived singletons.
Blast radius: zero
I probed every
spilnu/servicesrepo before opening this — phpstan with therule enabled, run in each repo's CI php image, filtered to identifier
larastan.octaneCompatibility:37 of 37 repos clean. 0 findings.
Not vacuous: 20
bind()/singleton()call sites across the fleet wereanalysed and cleared. They pass because they either use
static functionclosures (which cannot bind
$this) or take the container explicitly.So no baseline regeneration is needed anywhere, and no currently-passing
phpstan job starts failing. Verified end-to-end too: with the rule forced on
against a real generated
phpstan.neon, it fires on the expected lines andadds no other errors.
Note
Needs a new tag before Renovate picks it up — merging alone propagates
nothing.