@@ -7,6 +7,97 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ## [ 2.0.0] - 2026-05-06
11+
12+ Major release focused on ** dramatically reducing false positives** in
13+ architectural / SOLID analysis on framework projects (Laravel and Symfony).
14+ The headline change is that ` --type=laravel ` is now a real, opinionated preset
15+ instead of a near-no-op flag.
16+
17+ ### Breaking changes
18+
19+ - ** Layer classification is now rule-based.** The previous
20+ ` (layer ⇒ namespace[] + suffix[]) ` lookup is replaced by an ordered list of
21+ glob ` LayerRule ` objects (first match wins). ` array_merge_recursive ` is gone.
22+ Custom ` ProjectTypeInterface ` implementations must implement the new
23+ ` getLayerRules() ` method (defaults provided in ` AbstractProjectType ` ).
24+ - ** ` *Action ` is no longer classified as ` Controller ` in Laravel.** It maps to
25+ ` Application ` (use case). This eliminates ~ 12 spurious
26+ "Infrastructure → Controller" violations on a typical Laravel app using the
27+ Action pattern.
28+ - ** ` Wiring ` is now a layer.** ` ServiceProvider ` , container extensions and
29+ files under ` **\\Providers\\** ` are flagged as ` Wiring ` , exempt from layer
30+ violation reporting and from DIP scoring. Their job is precisely to bind
31+ concrete classes from any layer, so the previous violations were noise.
32+ - ** DIP scope reduced to injected dependencies.** Only ` type_hint_param ` ,
33+ ` type_hint_return ` , and ` type_hint_property ` count toward the abstraction
34+ ratio. ` extends ` , ` trait ` , ` new ` , ` static_call ` , ` instanceof ` , ` catch ` ,
35+ ` implements ` , ` const ` , ` use ` no longer pollute the metric. Old DIP scores
36+ are not comparable.
37+ - ** DIP whitelist by default.** The Laravel preset excludes Eloquent
38+ primitives, Carbon, Closure, facades, queue/bus traits, and OpenAPI
39+ attributes from the DIP ratio. The Symfony preset excludes Doctrine ORM,
40+ HttpFoundation, Form, Validator, Security, Twig, etc. This eliminates the
41+ pathological case of e.g. ` OrganizationController ` flagged with
42+ ` 104/104 concrete dependencies ` .
43+ - ** ` ProjectTypeInterface ` gains 3 methods** : ` getLayerRules() ` ,
44+ ` getDipIgnoreList() ` , ` getWiringPatterns() ` . ` AbstractProjectType ` provides
45+ generic defaults so existing custom types still compile, but presets that
46+ want framework-aware behaviour must override them.
47+ - ** ` SolidAnalyzer::analyze() ` and ` ArchitectureAnalyzer::analyze() ` signatures
48+ changed.** ` SolidAnalyzer::analyze(array $fileResults, array $dipIgnoreList = [], array $wiringClasses = [], array $classIgnores = []) ` ; ` ArchitectureAnalyzer::analyze(array $fileResults, ?ProjectTypeInterface $projectType = null, ?ProjectConfig $config = null) ` .
49+ - ** ` ProjectAnalyzer ` constructor now requires ` ProjectConfigLoader ` and
50+ ` BaselineManager ` .** Symfony autowiring picks them up automatically.
51+
52+ ### Added
53+
54+ - ** ` phpquality.json ` project configuration file** at the project root.
55+ Schema (all keys optional):
56+ ``` json
57+ {
58+ "layers" : { "rules" : [{ "match" : " App\\ Foo\\ **" , "layer" : " Application" }] },
59+ "wiring" : { "patterns" : [" **ServiceProvider" ] },
60+ "abstractionRatio" : { "ignore" : [" App\\ Models\\ **" ] },
61+ "ignore" : { "violations" : [" solid.dip:App\\ Foo\\ Bar" ] },
62+ "baseline" : " phpquality.baseline.json"
63+ }
64+ ```
65+ ` layers.rules ` is ** prepended** to the framework preset (project rules win).
66+ ` wiring.patterns ` , ` abstractionRatio.ignore ` , ` ignore.violations ` are
67+ ** unioned** with framework defaults.
68+ - ** ` @phpquality-ignore ` docblock annotation** on classes and interfaces:
69+ ``` php
70+ /** @phpquality-ignore solid.dip — wiring intentionnel */
71+ final class FooService { … }
72+ ```
73+ Codes: ` solid.srp ` , ` solid.dip ` , ` solid.isp ` , ` architecture.layer ` .
74+ - ** Baseline generation and application** .
75+ - ` --generate-baseline=phpquality.baseline.json ` writes a hash-keyed list of
76+ all current violations and exits successfully (does not fail-on-violation).
77+ - ` --baseline=phpquality.baseline.json ` filters violations whose hash is in
78+ the baseline. The summary exposes ` suppressedByBaseline ` and warns about
79+ ` obsoleteBaselineEntries ` (entries that no longer match anything →
80+ regenerate).
81+ - New CLI options: ` --config ` , ` --baseline ` , ` --generate-baseline ` .
82+ - New services: ` PhpQuality\Config\ProjectConfigLoader ` ,
83+ ` PhpQuality\Config\BaselineManager ` , ` PhpQuality\Config\ProjectConfig ` ,
84+ ` PhpQuality\Config\LayerRule ` ,
85+ ` PhpQuality\Analyzer\Ast\IgnoreAnnotationParser ` .
86+
87+ ### Migrating from 1.x
88+
89+ Most users only need to run the new version: false positives drop on their
90+ own. If you previously had a CI policy on the violation counts, expect those
91+ counts to ** decrease** .
92+
93+ If you have a custom ` ProjectTypeInterface ` implementation:
94+ 1 . Have it extend ` AbstractProjectType ` (gets the 3 new methods for free), OR
95+ 2 . Implement ` getLayerRules() ` , ` getDipIgnoreList() ` , ` getWiringPatterns() ` .
96+
97+ If you want to keep some violations in your reports while you migrate, pin
98+ them via ` --generate-baseline ` and commit the baseline file. Subsequent runs
99+ with ` --baseline=… ` will only show new violations.
100+
10101## [ 1.6.0] - 2026-03-26
11102
12103### Added
@@ -107,7 +198,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
107198### Fixed
108199- Allow running Docker container with any user (` --user ` flag)
109200
110- [ Unreleased ] : https://github.com/amoifr/PhpQuality/compare/v1.6.0...HEAD
201+ [ Unreleased ] : https://github.com/amoifr/PhpQuality/compare/v2.0.0...HEAD
202+ [ 2.0.0 ] : https://github.com/amoifr/PhpQuality/compare/v1.6.0...v2.0.0
111203[ 1.6.0 ] : https://github.com/amoifr/PhpQuality/compare/v1.5.0...v1.6.0
112204[ 1.5.0 ] : https://github.com/amoifr/PhpQuality/compare/v1.4.1...v1.5.0
113205[ 1.4.1 ] : https://github.com/amoifr/PhpQuality/compare/v1.4.0...v1.4.1
0 commit comments