Skip to content

1.21.0

Latest

Choose a tag to compare

@Chemaclass Chemaclass released this 26 Jul 01:36
1.21.0
32fef1b

Static analysis now types the pillar accessors instead of suppressing them, and the
console gained checks for the mistakes that were previously silent. Both are worth having
before you migrate to 2.0.

Added

  • gacela init scaffolds a project's gacela.php — the one file you had to copy from the docs before anything ran. Refuses to overwrite unless --force
  • PHPStan types getFacade()/getFactory()/getConfig() from #[ServiceMap] instead of suppressing them. A suppressed call is not a typed one: it evaluated to mixed, which switched off checking of everything reached through the accessor. Nothing to configure beyond the existing phpstan-gacela.neon include; the suppression stays as a fallback for classes declaring neither #[ServiceMap] nor a @method docblock, and goes away in 2.0
  • PHPStan types getProvidedDependency(Foo::class) as Foo, so the class-string form needs no hand-written @var. String keys stay mixed
  • FacadeInterfaceInSyncRule reports public Facade methods missing from the Facade's own *FacadeInterface — drift that is invisible until someone reads both files, by which point the fix is breaking. Only fires for a facade that implements the interface named after it
  • doctor reports pillar classes whose filename does not match the class. Pillars resolve by filename suffix, so migrating AbstractDependencyProvider means renaming DependencyProvider.php to Provider.php too — miss it and the module silently stops resolving
  • doctor --strict exits non-zero on warnings as well as errors, so it can gate CI
  • debug:graph --check exits non-zero on a module dependency cycle. --allowed-cycles=file.json records the ones a reviewer accepted, each with a mandatory reason, and an entry that no longer matches a real cycle fails just as loudly — an allow-list that outlives what it allows is a mute button. Without --check the command stays exit-code-neutral
  • debug:graph --compare-to=base-graph.json diffs against a previously captured graph and reports the change as markdown with a mermaid diagram. Writes nothing when the graph is unchanged, so CI can comment only when a pull request actually moves a boundary

Changed

  • profile:report --format=json and debug:config now raise a JsonException instead of printing an empty value when their payload cannot be encoded
  • validate:config attributes an unloadable binding class to that binding (Could not resolve binding: <key> (<error>)) instead of reporting a separate "Could not check circular dependencies" line
  • debug:container <class> no longer prints "Indentation shows dependency depth" — the container returns a flat list, so nothing was ever indented

Documentation

  • A Factory can declare its dependencies in its constructor: pillars resolve through the container, so autowiring applies to the Factory itself. This already worked and is now documented and tested
  • docs/rfc/0002 inventories every way to obtain a dependency (25 paths across 4 intents), as the basis for naming one primary path per intent in 2.0