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 Laravel Package

ibexa/phpstan

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Purpose: This package is a PHPStan extension tailored for Ibexa DXP (a Laravel-based CMS framework). It enforces static analysis rules specific to Ibexa’s codebase, including custom Ibexa-specific types, annotations, and business logic patterns.
  • Fit for Laravel Projects:
    • Moderate Fit: While Ibexa DXP is built on Laravel, this package is highly specialized for Ibexa’s ecosystem (e.g., Ibexa-specific services, repositories, and domain models). A generic Laravel project would gain limited direct value unless it heavily mirrors Ibexa’s architecture.
    • Indirect Value: Could serve as a reference for custom PHPStan rules if a Laravel project requires deep static analysis for proprietary or complex domain logic.
  • Key Features:
    • Extends PHPStan with Ibexa-specific rules (e.g., validation of Ibexa’s Content, Location, or FieldType APIs).
    • Likely includes custom type hints for Ibexa’s service containers, repositories, and domain objects.
    • May enforce deprecated API usage or best practices unique to Ibexa DXP.

Integration Feasibility

  • Dependencies:
    • Hard Dependency: Requires Ibexa DXP (not standalone Laravel). Installing this package without Ibexa DXP will result in broken rules or errors due to missing Ibexa-specific classes/interfaces.
    • Soft Dependency: Requires PHPStan (v0.12+ recommended in Ibexa’s docs).
  • Compatibility:
    • Laravel Version: Ibexa DXP is built on Laravel 5.x/6.x (legacy). If using Laravel 8/9/10, integration would require backporting or abstraction layers.
    • PHP Version: Likely targets PHP 7.4–8.1 (Ibexa DXP’s supported range).
  • Customization:
    • Rules are not plug-and-play for Laravel. Would need forking/modification to adapt to Laravel’s service container, Eloquent, or custom logic.
    • Example: Ibexa’s ContentService rules would need replacement with Laravel’s Repository or Service patterns.

Technical Risk

  • High Risk for Non-Ibexa Projects:
    • False Positives/Negatives: Rules assume Ibexa’s architecture (e.g., Content objects, Location trees). Laravel’s Model or Collection patterns would trigger irrelevant errors.
    • Breaking Changes: Ibexa DXP’s API is not Laravel-first. Migrating rules to Laravel would require significant refactoring.
  • Medium Risk for Ibexa DXP Users:
    • Version Lock: Tied to Ibexa DXP’s release cycle. Upgrading PHPStan or Ibexa may break rules.
    • Maintenance Overhead: Custom rules require ongoing sync with Ibexa’s evolving codebase.
  • Licensing Risk:
    • Proprietary License: Ibexa’s Business Use License (BUL) restricts use to paid Ibexa DXP subscribers. Open-source or non-Ibexa projects cannot legally use this package without a trial/test license.

Key Questions for Adoption

  1. Is Ibexa DXP a Hard Requirement?
    • If yes, proceed with Ibexa’s official integration guide.
    • If no, evaluate whether custom PHPStan rules (written for Laravel) would suffice.
  2. What’s the Laravel/Ibexa DXP Overlap?
    • Are you using Ibexa’s content repository, field types, or service layer? If not, this package offers zero value.
  3. Can Rules Be Abstracted?
    • Could Ibexa-specific rules be generalized (e.g., for CMS-like Laravel apps with custom domain models)?
  4. Licensing Compliance
    • Is the project eligible for Ibexa BUL or TTL? If not, this package is non-compliant.
  5. Alternatives Exist?
    • Laravel-specific tools like:
      • phpstan/extension-installer
      • vimeo/psalm (for stricter static analysis)
      • Custom PHPStan rules for Laravel’s Model, Policy, or ServiceProvider patterns.

Integration Approach

Stack Fit

  • Target Stack: Ibexa DXP + Laravel 5.x/6.x + PHP 7.4–8.1.
    • Direct Fit: Only for Ibexa DXP projects. No direct benefit for vanilla Laravel.
    • Partial Fit: If using Ibexa’s plugins (e.g., ezplatform-admin-ui), rules may apply to those components.
  • Laravel-Specific Workarounds:
    • For non-Ibexa Laravel apps, consider:
      • PHPStan’s generate-never-return-rules.php for custom rules.
      • Psalm for stricter type checking.
      • Laravel-specific extensions (e.g., laravel-shift/phpstan).

Migration Path

Step Action Risk Notes
1 Assess Dependency on Ibexa DXP Low Confirm if project uses Ibexa’s core APIs.
2 Install Ibexa DXP (if missing) High Requires full DXP setup (not just this package).
3 Configure PHPStan Medium Add to phpstan.neon as per Ibexa’s docs.
4 Run Static Analysis Low Test on a small Ibexa module first.
5 Customize Rules (if needed) High Fork/modify rules for Laravel-specific logic.
6 CI/CD Integration Medium Add PHPStan to linting pipeline.

Compatibility

  • PHPStan Version:
    • Ibexa’s docs likely specify a range (e.g., 0.12–1.0). Ensure compatibility.
    • Newer PHPStan versions may break Ibexa’s rules.
  • Laravel Compatibility:
    • Laravel 8+: May require polyfills or rule overrides due to Ibexa’s legacy Laravel 5.x patterns.
    • Ibexa Plugins: Rules may only apply to Ibexa’s bundles (e.g., EzSystemsPlatformAdminUi).
  • Toolchain Conflicts:
    • PSR-12 vs. Ibexa’s Coding Standards: Rules may enforce Ibexa-specific PSR deviations.

Sequencing

  1. Phase 1: Proof of Concept
    • Install in a non-production Ibexa DXP environment.
    • Run PHPStan on a single Ibexa module (e.g., ezplatform-admin-ui).
    • Validate false positives/negatives.
  2. Phase 2: Gradual Rollout
    • Integrate into CI pipeline (e.g., GitHub Actions).
    • Start with warning-level rules, then enforce as errors.
  3. Phase 3: Customization (If Needed)
    • Fork the package and replace Ibexa-specific rules with Laravel equivalents.
    • Example: Replace ContentService checks with Repository or Service checks.
  4. Phase 4: Maintenance
    • Monitor for rule breakage on Ibexa DXP updates.
    • Sync with Ibexa’s release cycle.

Operational Impact

Maintenance

  • High Ongoing Effort for Non-Ibexa Projects:
    • Rules are tightly coupled to Ibexa’s internals. Any deviation (e.g., custom Laravel services) requires manual rule updates.
  • Moderate Effort for Ibexa DXP Projects:
    • Depends on Ibexa’s release cycle. New Ibexa versions may break existing rules.
    • Requires periodic sync with Ibexa’s PHPStan updates.
  • Dependency Bloat:
    • Pulls in Ibexa’s entire ecosystem (even if only using this package). Increases composer lockfile complexity.

Support

  • Limited Community Support:
    • 0 stars, no dependentsNo active community.
    • Official support only via Ibexa’s paid channels.
  • Debugging Challenges:
    • Errors may reference Ibexa-specific classes (e.g., Content, Location), which are unfamiliar to Laravel devs.
    • Stack traces will point to Ibexa’s internals, not Laravel’s.
  • Fallback Options:
    • Ibexa DXP Support: If using Ibexa, engage Ibexa’s team for rule issues.
    • PHPStan Community: For general PHPStan problems (but Ibexa-specific rules are unsupported).

**

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky