This PR introduces a new GrumPHP extension system for v2.
Since the new implementation does not leak the dependency with symfony/dependency-injection to the PHP API of an extension, we can make any extension work in grumphp-shim (PHAR distribition) with scoped dependencies as well.
A well calculated downside of this, is that an extension maintainer is now forced to configure the service declarations in a separate YAML (or xml, ...) file where previously this could be done directly from PHP.
Breaking change:
class MyExtension implements ExtensionInterface
{
- public function load(ContainerBuilder $container): void { /* ... */ }
+ public function imports(): iterable {
+ yield '/path/to/my/config.yaml';
+ }
}
And make sure all services are registered through a symfony/dependency-injection compatible configuration file.
(YAML, XML, INI, ...) - PHP is not supported because of the scoped vendor in the PHAR.
Fixes https://github.com/phpro/grumphp-shim/issues/20
This PR introduces a new GrumPHP extension system for v2. Since the new implementation does not leak the dependency with
symfony/dependency-injection
to the PHP API of an extension, we can make any extension work in grumphp-shim (PHAR distribition) with scoped dependencies as well.A well calculated downside of this, is that an extension maintainer is now forced to configure the service declarations in a separate YAML (or xml, ...) file where previously this could be done directly from PHP.
Breaking change:
And make sure all services are registered through a
symfony/dependency-injection
compatible configuration file. (YAML, XML, INI, ...) - PHP is not supported because of the scoped vendor in the PHAR.More info : https://symfony.com/doc/current/service_container.html