Skip to content

Blade: skip view data members declared in vendor#350

Merged
janedbal merged 1 commit intomasterfrom
jn-blade-skip-vendor-inherited
Apr 29, 2026
Merged

Blade: skip view data members declared in vendor#350
janedbal merged 1 commit intomasterfrom
jn-blade-skip-vendor-inherited

Conversation

@janedbal
Copy link
Copy Markdown
Member

@janedbal janedbal commented Apr 28, 2026

Summary

The Blade view data traverser walked all public methods/properties of every class passed to views, including those inherited from vendor base classes and traits — e.g. Eloquent's Model plus its many traits emit ~200+ inherited methods on every concrete model. Combined with the per-call retraversal of the model graph, projects with many view() calls passing models could see millions of emitted usages — enough to OOM during the unpack loop in DeadCodeRule (#349).

This change filters out methods/properties whose declaring class lives outside analysedPaths, matching the filter EloquentUsageProvider::getMethodUsagesFromReflection already applies. User-land parent classes and traits are still covered because getMethods()/getProperties() returns inherited members and the file-of-declaring-class check naturally keeps user-land ones.

Refs #349.

The Blade view data traverser walked all public methods/properties of
classes passed to views, including those inherited from vendor base
classes and traits (e.g. Eloquent's Model emits ~200+ inherited methods).
For projects with many view() calls passing models, this produced an
explosion of emitted usages — sometimes enough to OOM (#349).

Filter out members whose declaring class lives outside analysed paths,
matching the approach EloquentUsageProvider already uses. User-land
parent classes and traits are still picked up because their declaring
class file is in analysed paths.
@janedbal janedbal force-pushed the jn-blade-skip-vendor-inherited branch from 00599be to 1247df6 Compare April 28, 2026 16:34
@janedbal janedbal marked this pull request as ready for review April 29, 2026 06:16
@janedbal janedbal merged commit 1b339da into master Apr 29, 2026
32 checks passed
@janedbal janedbal deleted the jn-blade-skip-vendor-inherited branch April 29, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant