Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpstan Sealed Classes Laravel Package

jiripudil/phpstan-sealed-classes

PHPStan extension to enforce “sealed” classes in PHP: declare which classes may extend a base class and report violations during static analysis. Helps keep inheritance under control, prevent accidental subclassing, and maintain clear, stable APIs.

Deep Wiki
Context7

Product Decisions This Supports

  • Enforces strict inheritance rules for sealed classes, reducing unintended subclassing and improving code maintainability.
  • Supports architectural decisions around immutable or tightly controlled class hierarchies (e.g., value objects, domain entities).
  • Integrates into CI/CD pipelines to catch violations early, reducing technical debt and debugging time.
  • Enables safer refactoring by ensuring sealed class contracts are respected across the codebase.

When to Consider This Package

  • ✅ Adopt when: Using PHP 8.1+ with sealed classes in your codebase; already using PHPStan for static analysis; needing to enforce strict inheritance boundaries in critical domain models.
  • ❌ Avoid when: Project uses PHP <8.1 or doesn’t implement sealed classes; using alternative static analysis tools like Psalm; team lacks experience with PHPStan.

How to Pitch It (Stakeholders)

  • Executives: "This tool proactively prevents bugs caused by unintended class inheritance, reducing production incidents and maintenance costs. By integrating with our existing PHPStan setup, it ensures code quality without slowing down development—directly impacting time-to-market for new features."
  • Engineering: "Zero-runtime-overhead extension for PHPStan that validates sealed class usage during development and CI. Simple to configure:
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests