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

Phpquality Bundle Laravel Package

amoifr/phpquality-bundle

View on GitHub
Deep Wiki
Context7
2.0.0

Major release focused on dramatically reducing false positives in architectural / SOLID analysis on framework projects (Laravel and Symfony). The headline change is that --type=laravel is now a real, opinionated preset instead of a near-no-op flag.

Breaking changes

  • Layer classification is now rule-based. The previous (layer ⇒ namespace[] + suffix[]) lookup is replaced by an ordered list of glob LayerRule objects (first match wins). array_merge_recursive is gone. Custom ProjectTypeInterface implementations must implement the new getLayerRules() method (defaults provided in AbstractProjectType).
  • *Action is no longer classified as Controller in Laravel. It maps to Application (use case). This eliminates ~12 spurious "Infrastructure → Controller" violations on a typical Laravel app using the Action pattern.
  • Wiring is now a layer. ServiceProvider, container extensions and files under **\\Providers\\** are flagged as Wiring, exempt from layer violation reporting and from DIP scoring. Their job is precisely to bind concrete classes from any layer, so the previous violations were noise.
  • DIP scope reduced to injected dependencies. Only type_hint_param, type_hint_return, and type_hint_property count toward the abstraction ratio. extends, trait, new, static_call, instanceof, catch, implements, const, use no longer pollute the metric. Old DIP scores are not comparable.
  • DIP whitelist by default. The Laravel preset excludes Eloquent primitives, Carbon, Closure, facades, queue/bus traits, and OpenAPI attributes from the DIP ratio. The Symfony preset excludes Doctrine ORM, HttpFoundation, Form, Validator, Security, Twig, etc. This eliminates the pathological case of e.g. OrganizationController flagged with 104/104 concrete dependencies.
  • ProjectTypeInterface gains 3 methods: getLayerRules(), getDipIgnoreList(), getWiringPatterns(). AbstractProjectType provides generic defaults so existing custom types still compile, but presets that want framework-aware behaviour must override them.
  • SolidAnalyzer::analyze() and ArchitectureAnalyzer::analyze() signatures changed. SolidAnalyzer::analyze(array $fileResults, array $dipIgnoreList = [], array $wiringClasses = [], array $classIgnores = []); ArchitectureAnalyzer::analyze(array $fileResults, ?ProjectTypeInterface $projectType = null, ?ProjectConfig $config = null).
  • ProjectAnalyzer constructor now requires ProjectConfigLoader and BaselineManager. Symfony autowiring picks them up automatically.

Added

  • phpquality.json project configuration file at the project root. Schema (all keys optional):
    {
      "layers":           { "rules": [{ "match": "App\\Foo\\**", "layer": "Application" }] },
      "wiring":           { "patterns": ["**ServiceProvider"] },
      "abstractionRatio": { "ignore":   ["App\\Models\\**"] },
      "ignore":           { "violations": ["solid.dip:App\\Foo\\Bar"] },
      "baseline":         "phpquality.baseline.json"
    }
    
    layers.rules is prepended to the framework preset (project rules win). wiring.patterns, abstractionRatio.ignore, ignore.violations are unioned with framework defaults.
  • [@phpquality-ignore](https://github.com/phpquality-ignore) docblock annotation on classes and interfaces:
    /** [@phpquality-ignore](https://github.com/phpquality-ignore) solid.dip — wiring intentionnel */
    final class FooService { … }
    
    Codes: solid.srp, solid.dip, solid.isp, architecture.layer.
  • Baseline generation and application.
    • --generate-baseline=phpquality.baseline.json writes a hash-keyed list of all current violations and exits successfully (does not fail-on-violation).
    • --baseline=phpquality.baseline.json filters violations whose hash is in the baseline. The summary exposes suppressedByBaseline and warns about obsoleteBaselineEntries (entries that no longer match anything → regenerate).
  • New CLI options: --config, --baseline, --generate-baseline.
  • New services: PhpQuality\Config\ProjectConfigLoader, PhpQuality\Config\BaselineManager, PhpQuality\Config\ProjectConfig, PhpQuality\Config\LayerRule, PhpQuality\Analyzer\Ast\IgnoreAnnotationParser.

Migrating from 1.x

Most users only need to run the new version: false positives drop on their own. If you previously had a CI policy on the violation counts, expect those counts to decrease.

If you have a custom ProjectTypeInterface implementation:

  1. Have it extend AbstractProjectType (gets the 3 new methods for free), OR
  2. Implement getLayerRules(), getDipIgnoreList(), getWiringPatterns().

If you want to keep some violations in your reports while you migrate, pin them via --generate-baseline and commit the baseline file. Subsequent runs with --baseline=… will only show new violations.

1.6.0

Added

  • Symfony Profiler panel showing PHP quality metrics for files used during request
  • CallstackTracer to capture controller information
  • DependencyTreeAnalyzer for static analysis of controller imports and dependencies
  • Debug information in profiler panel (mode, project directory, analyzed files count)

Changed

  • Profiler now analyzes controller dependency tree via use statements instead of all included files
  • Improved exclude paths filtering (relative to project root)

Fixed

  • DataCollector service visibility for Symfony Profiler integration
  • FileAnalyzer service marked as public for dependency injection
1.5.0

Added

  • Configuration file support for quality thresholds via config/packages/php_quality.yaml
  • Symfony Profiler integration with dedicated panel showing metrics for files loaded during request
  • ThresholdsConfig DTO for threshold management with framework defaults merging
  • Symfony Flex recipe for automatic bundle configuration on install
  • Development environment config enabling profiler by default

Changed

  • Thresholds can now be overridden per-project while keeping framework-specific defaults for non-configured values
1.4.1

Fixed

  • Memory limit handling for large project analysis
1.4.0

Added

  • Multi-architecture Docker build support (amd64 + arm64)

Fixed

  • Docker build with correct package name
1.3.0

Added

  • Interactive wizard mode for command configuration (--wizard or -w option)
1.2.2

Fixed

  • JSON report generation with proper error handling
1.2.1

Fixed

  • Twig template paths to use bundle namespace
1.2.0

Added

  • Symfony Bundle architecture (package renamed to amoifr/phpquality-bundle)
  • README translated to English

Changed

  • Refactored entire codebase to Symfony Bundle structure
  • Package renamed from standalone tool to Symfony bundle
1.1.0

Added

  • Code Coverage Analysis feature from Clover XML reports (--coverage option)
  • Architecture Analysis inspired by Deptrac/PHP Insights (layer detection, SOLID principles)
  • Hall of Fame/Shame feature using git blame (--git-blame option)
  • Comprehensive PHPUnit test suite
  • Translations for coverage and recommendations sections
  • 17 language translations for reports

Changed

  • Git blame analysis now optional (disabled by default)

Fixed

  • Docker Hub image name to amoifr13/phpquality
1.0.0

Added

  • Initial release of PhpQuality PHP Code Analyzer
  • Cyclomatic Complexity (CCN) analysis per method and file
  • Maintainability Index (MI) calculation with ratings (A-F)
  • Lines of Code metrics (LOC, LLOC, CLOC, comment ratio)
  • Halstead metrics (Volume, Difficulty, Effort, Bugs)
  • Lack of Cohesion of Methods (LCOM) analysis
  • HTML report generation with interactive charts
  • Console report output with tables and summaries
  • Multiple project type detection (Symfony, Laravel, WordPress, Magento, Drupal, etc.)
  • Docker support for containerized analysis
  • GitHub Actions workflow for Docker image publishing

Fixed

  • Allow running Docker container with any user (--user flag)
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai