You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the PHP-DI container with Respect/Config: ContainerRegistry now builds a
Respect\Config\Container, registering the rules' external dependencies (PHP ISO
Codes, libphonenumber, ramsey/uuid) and a ParameterResolver.
Instantiate rules through a new AutowiringLookup: a Respect\Fluent FluentFactory
that resolves the rule name and autowires its constructor dependencies from the
container via Respect\Parameter, wrapped by FluentValidatorFactory. The dead
NamespacedValidatorFactory is removed.
Drop static ContainerRegistry access from CountryCode, CurrencyCode, LanguageCode,
SubdivisionCode, Phone and Uuid: each accepts its external dependency and otherwise
constructs it directly, guarded by class_exists for the missing-package error. Inject
a ParameterResolver into Attributes so attribute-declared rules are autowired too.
Fix Email: drop the func_num_args() guard, which autowiring defeats (the resolver
always passes the defaulted argument), so v::email() uses egulias again instead of
silently falling back to filter_var.
Exclude the autowired dependency types from the generated mixins, update the docs,
and add AutowiringLookupTest.
The `ContainerRegistry::createContainer()` method returns a [PHP-DI](https://php-di.org/) container. The definitions array follows the [PHP-DI definitions format](https://php-di.org/doc/php-definitions.html).
11
+
The `ContainerRegistry::createContainer()` method returns a [Respect\Config](https://github.com/Respect/Config) container, which is [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible. Definitions may be plain values, closures, or Respect\Config's `Autowire`, `Instantiator`, and `Ref` helpers.
12
12
13
-
If you prefer to use a different container, `ContainerRegistry::setContainer()` accepts any [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible container:
13
+
If you prefer to use a different container, `ContainerRegistry::setContainer()` accepts any PSR-11 compatible container:
Copy file name to clipboardExpand all lines: docs/migrating-from-v2-to-v3.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,7 +504,7 @@ The `Factory` class has been replaced by a dependency injection container approa
504
504
+ ContainerRegistry::setContainer($container);
505
505
```
506
506
507
-
The `ContainerRegistry::createContainer()` returns a [PHP-DI](https://php-di.org/) container. You can also use any PSR-11 compatible container with `ContainerRegistry::setContainer()`.
507
+
The `ContainerRegistry::createContainer()` returns a [Respect\Config](https://github.com/Respect/Config) container, which is [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible. You can also use any PSR-11 compatible container with `ContainerRegistry::setContainer()`.
0 commit comments