Skip to content

v1.9.0

Choose a tag to compare

@coisa coisa released this 16 Oct 17:29
a9d7643

Fast Forward Container v1.9.0 replaces its internal PHP-DI engine with native constructor autowiring.

Added

  • Native constructor autowiring with recursive dependency resolution, shared instances, cycle diagnostics and cleanup after failed construction.
  • Standalone autowiring through new AutowireContainer(), with an optional nullable PSR-11 delegate whose entries take precedence over autowiring.
  • Support for constructor parameters passed by reference and optional internal arguments whose default values are unavailable through reflection.
  • Named exception factories for circular dependency paths and unresolvable constructor parameters.
  • A versioned changelog, including the release history from 1.0.0 through 1.8.0.

Changed

  • Optional named object dependencies resolve explicit container entries or autowire concrete classes before using their declared defaults, including non-null defaults.
  • Missing entries and structurally unavailable dependency graphs use an optional argument's default. Autoloader, constructor, factory, type, cycle and default-expression failures remain errors with their original causes preserved.
  • Aggregate lookups still try later sources after delegated failures, but preserve the first construction exception when no source succeeds instead of reporting a fresh not-found exception.
  • AutowireContainer::has() checks whether an entry is known without calling get(). Known classes or entries may return true even when construction fails; unknown entries return false and get() throws NotFoundExceptionInterface, following PSR-11. Applications that used has() as a construction health check must call get() and handle resolution errors instead.
  • The public AutowireContainer, ContainerBuilder, ContainerFactory and container() APIs remain available. PHP ^8.3 remains the minimum requirement.
  • Optional dependencies may now execute constructors that were previously skipped. A nullable argument without a default remains required.
  • Applications that use PHP-DI directly must declare their own dependency. External PHP-DI containers remain usable as PSR-11 sources.
  • Scalars, ambiguous union/intersection/DNF types and variadic collections require defaults or explicit service factories. See the autowiring guide for the complete contract.

Removed

  • The runtime php-di/php-di dependency and the internal PHP-DI autowiring engine.

Delivered through PR #18, addressing issue #17.

Validation: 166 tests, 405 assertions and 99.26% line coverage; PHP 8.3, 8.4 and 8.5 CI. The published Packagist distribution was installed and exercised without PHP-DI or development tooling, including standalone/delegated autowiring and error propagation for optional dependencies.

Changelog: CHANGELOG.md

Full changelog: v1.8.0...v1.9.0