├── config-add-entry.png ├── src ├── ContainerFactory.php ├── ConfigInterface.php ├── Tool │ ├── AutowiresConfigDumper.php │ └── AutowiresConfigDumperCommand.php └── Config.php ├── bin └── add-autowires-entry ├── LICENSE ├── docs └── migration-4.0.md ├── composer.json ├── README.md └── CHANGELOG.md /config-add-entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elie29/zend-di-config/HEAD/config-add-entry.png -------------------------------------------------------------------------------- /src/ContainerFactory.php: -------------------------------------------------------------------------------- 1 | configureContainer($builder); 20 | 21 | return $builder->build(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/ConfigInterface.php: -------------------------------------------------------------------------------- 1 | This decision is the conclusion of a discussion with [@thomasvargiu](https://github.com/thomasvargiu) within this issue [#28](https://github.com/elie29/zend-di-config/issues/28) and [Geert Eltink](https://github.com/xtreamwayz) through [#31](https://github.com/elie29/zend-di-config/issues/31). 14 | > The purpose of this change, is to provide a new `definitions` key to the configuration in order to add specfic PHP-DI defintions. For more details, check this issue [#27](https://github.com/elie29/zend-di-config/issues/27). 15 | 16 | ## Using PHP-DI Container 17 | 18 | In order to use the [PSR-11](http://www.php-fig.org/psr/psr-11/) container with [Zend Framework](https://framework.zend.com) or 19 | [Zend Expressive](https://docs.zendframework.com/zend-expressive), you need to add the following code in a `container.php` 20 | file as explained in README.md: 21 | 22 | ```php 23 | $dependencies */ 37 | $dependencies = $config['dependencies'] ?? []; 38 | 39 | $config['dependencies'] = $this->addAutowires($dependencies, $className); 40 | 41 | return $config; 42 | } 43 | 44 | public function dumpConfigFile(array $config): string 45 | { 46 | $prepared = $this->prepareConfig($config); 47 | 48 | return sprintf( 49 | self::CONFIG_TEMPLATE, 50 | static::class, 51 | date('Y-m-d H:i:s'), 52 | $prepared 53 | ); 54 | } 55 | 56 | private function addAutowires(array $dependencies, string $entry): array 57 | { 58 | if (! isset($dependencies[self::AUTOWIRES]) || ! is_array($dependencies[self::AUTOWIRES])) { 59 | $dependencies[self::AUTOWIRES] = []; 60 | } 61 | 62 | // Add the class name as an entry to the autowires configuration 63 | if (! in_array($entry, $dependencies[self::AUTOWIRES], true)) { 64 | $dependencies[self::AUTOWIRES][] = $entry; 65 | } 66 | 67 | return $dependencies; 68 | } 69 | 70 | private function prepareConfig(array $config, int $indentLevel = 1): string 71 | { 72 | $indent = str_repeat(' ', $indentLevel * 4); 73 | $entries = []; 74 | foreach ($config as $key => $value) { 75 | /** @var string|int $key */ 76 | $configKey = $this->createConfigKey($key); 77 | $entries[] = sprintf( 78 | '%s%s%s,', 79 | $indent, 80 | $configKey !== null ? sprintf('%s => ', $configKey) : '', 81 | $this->createConfigValue($value, $indentLevel) 82 | ); 83 | } 84 | 85 | $outerIndent = str_repeat(' ', ($indentLevel - 1) * 4); 86 | 87 | return sprintf("[\n%s\n%s]", implode("\n", $entries), $outerIndent); 88 | } 89 | 90 | /** 91 | * @param (int|string) $key 92 | * @psalm-param array-key $key 93 | */ 94 | private function createConfigKey(mixed $key): ?string 95 | { 96 | if (is_string($key) && class_exists($key)) { 97 | return sprintf('\\%s::class', $key); 98 | } 99 | 100 | if (is_int($key)) { 101 | return null; 102 | } 103 | 104 | return sprintf("'%s'", $key); 105 | } 106 | 107 | private function createConfigValue(mixed $value, int $indentLevel): string 108 | { 109 | if (is_array($value)) { 110 | return $this->prepareConfig($value, $indentLevel + 1); 111 | } 112 | 113 | if (is_string($value) && class_exists($value)) { 114 | return sprintf('\\%s::class', $value); 115 | } 116 | 117 | return var_export($value, true); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/Tool/AutowiresConfigDumperCommand.php: -------------------------------------------------------------------------------- 1 | Usage: 29 | 30 | %s [-h|--help|help] 31 | 32 | Arguments: 33 | 34 | -h|--help|help This usage message 35 | Path to a config file for which to generate 36 | configuration. If the file does not exist, it will 37 | be created. If it does exist, it must return an 38 | array, and the file will be updated with new 39 | configuration. 40 | Name of the class to reflect and to be added 41 | in as a new entry in the autowires configuration. 42 | 43 | Reads the provided configuration file (creating it if it does not exist) 44 | and adds the provided class name in the autowires array, writing the changes 45 | back to the file. The class name is added once. 46 | EOH; 47 | 48 | private ConsoleHelper $helper; 49 | 50 | public function __construct(private readonly string $scriptName = self::class, ?ConsoleHelper $helper = null) 51 | { 52 | $this->helper = $helper ?? new ConsoleHelper(); 53 | } 54 | 55 | /** 56 | * @param array $args Argument list, minus script name 57 | * @return int Exit status 58 | */ 59 | public function __invoke(array $args): int 60 | { 61 | $arguments = $this->parseArgs($args); 62 | 63 | switch ($arguments->command) { 64 | case self::COMMAND_HELP: 65 | $this->help(); 66 | return 0; 67 | case self::COMMAND_ERROR: 68 | $this->helper->writeErrorMessage($arguments->message); 69 | $this->help(STDERR); 70 | return 1; 71 | case self::COMMAND_DUMP: 72 | // fall-through 73 | default: 74 | break; 75 | } 76 | 77 | $dumper = new AutowiresConfigDumper(); 78 | 79 | /** @var array $config */ 80 | $config = $arguments->config; 81 | /** @var string $class */ 82 | $class = $arguments->class; 83 | $config = $dumper->createDependencyConfig($config, $class); 84 | 85 | file_put_contents($arguments->configFile, $dumper->dumpConfigFile($config)); 86 | 87 | $this->helper->writeLine(sprintf( 88 | '[DONE] Changes written to %s', 89 | $arguments->configFile 90 | )); 91 | 92 | return 0; 93 | } 94 | 95 | private function parseArgs(array $args): stdClass 96 | { 97 | if (!count($args)) { 98 | return $this->createHelpArgument(); 99 | } 100 | 101 | /** @var string|int|null $arg1 */ 102 | $arg1 = array_shift($args); 103 | 104 | if (in_array($arg1, ['-h', '--help', 'help'], true)) { 105 | return $this->createHelpArgument(); 106 | } 107 | 108 | if (!count($args)) { 109 | return $this->createErrorArgument('Missing class name'); 110 | } 111 | 112 | $configFile = (string)$arg1; 113 | switch (file_exists($configFile)) { 114 | case true: 115 | require $configFile; 116 | 117 | return $this->createErrorArgument(sprintf( 118 | 'Configuration at path "%s" does not return an array.', 119 | $configFile 120 | )); 121 | 122 | case false: 123 | // fall-through 124 | default: 125 | if (!is_writable(dirname($configFile))) { 126 | return $this->createErrorArgument(sprintf( 127 | 'Cannot create configuration at path "%s"; not writable.', 128 | $configFile 129 | )); 130 | } 131 | 132 | $config = []; 133 | break; 134 | } 135 | 136 | $class = (string)array_shift($args); 137 | 138 | if (!class_exists($class)) { 139 | return $this->createErrorArgument(sprintf( 140 | 'Class "%s" does not exist or could not be autoloaded.', 141 | $class 142 | )); 143 | } 144 | 145 | return $this->createArguments($configFile, $config, $class); 146 | } 147 | 148 | /** 149 | * @param bool|resource $resource Defaults to STDOUT 150 | */ 151 | private function help(mixed $resource = STDOUT): void 152 | { 153 | $this->helper->writeLine(sprintf( 154 | self::HELP_TEMPLATE, 155 | $this->scriptName 156 | ), true, $resource); 157 | } 158 | 159 | /** @psalm-suppress LessSpecificReturnStatement */ 160 | private function createArguments(string $configFile, array $config, string $class): stdClass 161 | { 162 | return (object)[ 163 | 'command' => self::COMMAND_DUMP, 164 | 'configFile' => $configFile, 165 | 'config' => $config, 166 | 'class' => $class, 167 | ]; 168 | } 169 | 170 | /** @psalm-suppress LessSpecificReturnStatement */ 171 | private function createErrorArgument(string $message): stdClass 172 | { 173 | return (object)[ 174 | 'command' => self::COMMAND_ERROR, 175 | 'message' => $message, 176 | ]; 177 | } 178 | 179 | /** @psalm-suppress LessSpecificReturnStatement */ 180 | private function createHelpArgument(): stdClass 181 | { 182 | return (object)[ 183 | 'command' => self::COMMAND_HELP, 184 | ]; 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /src/Config.php: -------------------------------------------------------------------------------- 1 | definitions = [self::CONFIG => $config]; 35 | } 36 | 37 | public function configureContainer(ContainerBuilder $builder): void 38 | { 39 | $this->shouldWriteProxiesToFile($builder); 40 | 41 | if (! $this->enableCompilation($builder)) { 42 | $this->setDependencies(); 43 | $this->addDefinitions($builder); 44 | } 45 | 46 | $this->useAutowire($builder); 47 | $this->enableCache($builder); 48 | } 49 | 50 | /** 51 | * @return bool true if compilation is enabled and CompiledContainer exists. 52 | */ 53 | private function enableCompilation(ContainerBuilder $builder): bool 54 | { 55 | $path = $this->definitions[self::CONFIG][self::DI_CACHE_PATH] ?? null; 56 | 57 | if ($path) { 58 | $builder->enableCompilation($path); 59 | return is_file(rtrim($path, '/') . '/CompiledContainer.php'); 60 | } 61 | 62 | return false; 63 | } 64 | 65 | private function setDependencies(): void 66 | { 67 | $this->dependencies = $this->definitions[self::CONFIG]['dependencies'] ?? []; 68 | } 69 | 70 | private function addDefinitions(ContainerBuilder $builder): void 71 | { 72 | $this->addServices(); 73 | $this->addFactories(); 74 | $this->addInvokables(); 75 | $this->addAutowires(); 76 | $this->addAliases(); 77 | $this->addDelegators(); 78 | 79 | /** 80 | * PHP-DI ArrayDefinition would resolve all keys 81 | * or dependencies are already resolved 82 | * (@see https://github.com/elie29/zend-di-config/issues/38) 83 | */ 84 | unset($this->definitions[self::CONFIG]['dependencies']); 85 | $this->dependencies = []; 86 | 87 | $builder->addDefinitions($this->definitions); 88 | } 89 | 90 | private function addServices(): void 91 | { 92 | foreach ($this->get('services') as $name => $service) { 93 | $this->definitions[$name] = is_object($service) ? $service : create($service); 94 | } 95 | } 96 | 97 | private function addFactories(): void 98 | { 99 | foreach ($this->get('factories') as $name => $factory) { 100 | $this->definitions[$name] = factory($factory); 101 | } 102 | } 103 | 104 | private function addInvokables(): void 105 | { 106 | foreach ($this->get('invokables') as $key => $object) { 107 | $name = is_numeric($key) ? $object : $key; 108 | $this->addInvokable($name, $object); 109 | } 110 | } 111 | 112 | private function addInvokable(string $name, string $service): void 113 | { 114 | $this->definitions[$name] = create($service); 115 | if ($name !== $service) { 116 | // create an alias to the service itself 117 | $this->definitions[$service] = get($name); 118 | } 119 | } 120 | 121 | private function addAutowires(): void 122 | { 123 | foreach ($this->get('autowires') as $name) { 124 | $this->definitions[$name] = autowire($name); 125 | } 126 | } 127 | 128 | private function addAliases(): void 129 | { 130 | foreach ($this->get('aliases') as $alias => $target) { 131 | $this->definitions[$alias] = get((string) $target); 132 | } 133 | } 134 | 135 | private function addDelegators(): void 136 | { 137 | foreach ($this->get('delegators') as $name => $delegators) { 138 | foreach ($delegators as $delegator) { 139 | $previous = $name . '-' . ++$this->delegatorCounter; 140 | $this->definitions[$previous] = $this->definitions[$name]; 141 | $this->definitions[$name] = $this->createDelegatorFactory($delegator, $previous, $name); 142 | } 143 | } 144 | } 145 | 146 | private function createDelegatorFactory(string $delegator, string $previous, string $name): DefinitionHelper 147 | { 148 | return factory(function ( 149 | ContainerInterface $container, 150 | string $delegator, 151 | string $previous, 152 | string $name 153 | ) { 154 | /** @psalm-suppress InvalidFunctionCall */ 155 | $factory = new $delegator(); 156 | $callable = function () use ($previous, $container) { 157 | return $container->get($previous); 158 | }; 159 | return $factory($container, $name, $callable); 160 | })->parameter('delegator', $delegator) 161 | ->parameter('previous', $previous) 162 | ->parameter('name', $name); 163 | } 164 | 165 | private function useAutowire(ContainerBuilder $builder): void 166 | { 167 | // default autowire is true 168 | $autowire = $this->definitions[self::CONFIG][self::USE_AUTOWIRE] ?? true; 169 | $builder->useAutowiring($autowire); 170 | } 171 | 172 | private function enableCache(ContainerBuilder $builder): void 173 | { 174 | if (! empty($this->definitions[self::CONFIG][self::ENABLE_CACHE_DEFINITION])) { 175 | $builder->enableDefinitionCache(); 176 | } 177 | } 178 | 179 | private function shouldWriteProxiesToFile(ContainerBuilder $builder): void 180 | { 181 | $path = $this->definitions[self::CONFIG][self::DI_PROXY_PATH] ?? null; 182 | if ($path) { 183 | $builder->writeProxiesToFile(true, $path); 184 | } 185 | } 186 | 187 | private function get(string $key): array 188 | { 189 | if (! isset($this->dependencies[$key]) || ! is_array($this->dependencies[$key])) { 190 | return []; 191 | } 192 | return $this->dependencies[$key]; 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zend-phpdi-config 2 | 3 | [![Build Status](https://github.com/elie29/zend-di-config/actions/workflows/php-build.yml/badge.svg)](https://github.com/elie29/zend-di-config/) 4 | [![Coverage Status](https://coveralls.io/repos/github/elie29/zend-di-config/badge.svg)](https://coveralls.io/github/elie29/zend-di-config) 5 | [![Packagist Downloads](https://img.shields.io/packagist/dt/elie29/zend-phpdi-config.svg)](https://packagist.org/packages/elie29/zend-phpdi-config) 6 | [![PHP Version](https://img.shields.io/packagist/php-v/elie29/zend-phpdi-config.svg)](https://packagist.org/packages/elie29/zend-phpdi-config) 7 | 8 | --- 9 | 10 | ## 🚀 Quick Start 11 | 12 | ```bash 13 | composer require elie29/zend-phpdi-config 14 | ``` 15 | 16 | ```php 17 | [ 72 | 'services' => [], 73 | 'invokables' => [], 74 | 'autowires' => [], // A new key added to support PHP-DI autowire technique 75 | 'factories' => [], 76 | 'aliases' => [], 77 | 'delegators' => [], 78 | ], 79 | // ... other configuration 80 | 81 | // Enable compilation 82 | Config::DI_CACHE_PATH => __DIR__, // Folder path 83 | 84 | // Write proxies to file : cf. https://php-di.org/doc/lazy-injection.html 85 | Config::DI_PROXY_PATH => __DIR__, // Folder path 86 | 87 | // Disable autowire (enabled by default) 88 | Config::USE_AUTOWIRE => false 89 | 90 | // Enable cache 91 | Config::ENABLE_CACHE_DEFINITION => false, // boolean, true if APCu is activated 92 | ]) 93 | ); 94 | ``` 95 | 96 | The `dependencies` sub associative array can contain the following keys: 97 | 98 | - `services`: an associative array that maps a key to a specific service instance or service name. 99 | - `invokables`: an associative array that map a key to a constructor-less 100 | service; i.e., for services that do not require arguments to the constructor. 101 | The key and service name usually are the same; if they are not, the key is 102 | treated as an alias. It could also be an array of services. 103 | - `autowires`: an array of service **with or without a constructor**; 104 | PHP-DI offers an autowire technique that will scan the code and see 105 | what are the parameters needed in the constructors. 106 | Any aliases needed should be created in the aliases configuration. 107 | - `factories`: an associative array that maps a service name to a factory class 108 | name, or any callable. Factory classes must be instantiable without arguments, 109 | and callable once instantiated (i.e., implement the `__invoke()` method). 110 | - `aliases`: an associative array that maps an alias to a service name (or 111 | another alias). 112 | - `delegators`: an associative array that maps service names to lists of 113 | delegator factory keys, see the 114 | [Expressive delegators documentation](https://docs.laminas.dev/laminas-servicemanager/delegators/) 115 | for more details. 116 | 117 | > **N.B.:** The whole configuration -- unless `dependencies` -- is merged in a `config` key within the `$container`: 118 | > 119 | > ```php 120 | > $config = $container->get('config'); 121 | > ``` 122 | 123 | --- 124 | 125 | ## 💻 CLI Usage 126 | 127 | The CLI command `add-autowires-entry` creates the configuration file if it doesn't exist, otherwise it adds the entry 128 | to the autowires key. 129 | 130 | Example of adding ConsoleHelper to a config.php: 131 | 132 | ```console 133 | ./vendor/bin/add-autowires-entry config.php "Laminas\\Stdlib\\ConsoleHelper" 134 | [DONE] Changes written to config.php 135 | ``` 136 | 137 | You can also add this as a Composer script: 138 | 139 | ```json 140 | "scripts": { 141 | "add-autowire": "add-autowires-entry config.php \"My\\Service\\Class\"" 142 | } 143 | ``` 144 | 145 | --- 146 | 147 | ## 🐞 Troubleshooting / FAQ 148 | 149 | **Q: My service is not autowired.** 150 | A: Ensure it is listed in the `autowires` array and all dependencies are available. 151 | 152 | **Q: The CLI tool fails with a permissions error.** 153 | A: Make sure the config file directory is writable. 154 | 155 | **Q: How do I debug container errors?** 156 | A: Check that all dependencies are correctly defined and that your factories do not throw exceptions. 157 | 158 | --- 159 | 160 | ## Using with Mezzio (formerly Expressive) 161 | 162 | Replace contents of `config/container.php` with the following: 163 | 164 | ```php 165 | $this->getDependencies() 202 | ]; 203 | } 204 | 205 | /** 206 | * Returns the container dependencies 207 | */ 208 | public function getDependencies(): array 209 | { 210 | return [ 211 | 'autowires' => [ 212 | UserManager::class 213 | ] 214 | ]; 215 | } 216 | } 217 | ``` 218 | 219 | Where UserManager depends on Mailer as follow: 220 | 221 | ```php 222 | mailer = $mailer; 233 | } 234 | 235 | public function register($email, $password) 236 | { 237 | $this->mailer->mail($email, 'Hello and welcome!'); 238 | } 239 | } 240 | 241 | class Mailer 242 | { 243 | public function mail($recipient, $content) 244 | { 245 | } 246 | } 247 | 248 | ``` 249 | 250 | ## Switching back to another container 251 | 252 | To switch back to another container is very easy: 253 | 254 | 1. Create your factories with `__invoke` function 255 | 2. Replace `autowires` key in ConfigProvider by `factories` key, then for each class name attach its correspondent factory. 256 | 257 | ## PSR 11 and Interop\Container\ContainerInterface 258 | 259 | V4.x supports as well Interop\Container\ContainerInterface 260 | 261 | ## Migration guides 262 | 263 | - [Migration from 3.x to 4.0](docs/migration-4.0.md) 264 | - Migration from 4.x to 5.0: container-interop/container-interop was dropped in favor of [PSR-11](https://packagist.org/packages/psr/container). 265 | 266 | --- 267 | 268 | ## 🤝 Contributing 269 | 270 | See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute, run tests, and submit pull requests. 271 | 272 | --- 273 | 274 | ## 📄 License 275 | 276 | This project is licensed under the MIT License. See [LICENSE](LICENSE) for details. 277 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file, in reverse chronological order by release. 4 | 5 | ## V10.0.2 - TBD 6 | 7 | ### Added 8 | 9 | - Nothing. 10 | 11 | ### Changed 12 | 13 | - [#63](https://github.com/elie29/zend-di-config/issues/63) Update tests to use only PHPUnit 14 | 15 | ### Deprecated 16 | 17 | - Nothing. 18 | 19 | ### Removed 20 | 21 | - Nothing. 22 | 23 | ### Fixed 24 | 25 | - Nothing. 26 | 27 | ## V10.0.1 - 2025-12-12 28 | 29 | ### Added 30 | 31 | - Nothing. 32 | 33 | ### Changed 34 | 35 | - PHPUnit v11 and some typos in a readme file. 36 | 37 | ### Deprecated 38 | 39 | - Nothing. 40 | 41 | ### Removed 42 | 43 | - Nothing. 44 | 45 | ### Fixed 46 | 47 | - Nothing. 48 | 49 | ## V10.0.0 - 2025-12-05 50 | 51 | ### Added 52 | 53 | - Nothing. 54 | 55 | ### Changed 56 | 57 | - [#61](https://github.com/elie29/zend-di-config/issues/61) Upgrade project to PHP 8.2 and PHPUnit 10 with updated 58 | dependency stack 59 | 60 | ### Deprecated 61 | 62 | - Nothing. 63 | 64 | ### Removed 65 | 66 | - Nothing. 67 | 68 | ### Fixed 69 | 70 | - Nothing. 71 | 72 | ## V9.0.3 2025-12-05 73 | 74 | ### Added 75 | 76 | - Nothing. 77 | 78 | ### Changed 79 | 80 | - [#60](https://github.com/elie29/zend-di-config/pull/60) Perform a minor dependencies update with Composer 81 | 82 | ### Deprecated 83 | 84 | - Nothing. 85 | 86 | ### Removed 87 | 88 | - Nothing. 89 | 90 | ### Fixed 91 | 92 | - Nothing. 93 | 94 | ## V9.0.2 - 2025-03-11 95 | 96 | ### Added 97 | 98 | - Nothing. 99 | 100 | ### Changed 101 | 102 | - [#59](https://github.com/elie29/zend-di-config/pull/59) Psalm (static analysis tool) integration instead of phpstan 103 | 104 | ### Deprecated 105 | 106 | - Nothing. 107 | 108 | ### Removed 109 | 110 | - Nothing. 111 | 112 | ### Fixed 113 | 114 | - Nothing. 115 | 116 | ## V9.0.1 - 2023-03-28 117 | 118 | ### Added 119 | 120 | - Nothing. 121 | 122 | ### Changed 123 | 124 | - [#57](https://github.com/elie29/zend-di-config/pull/57) Added support to PHP-DI 7.0 125 | 126 | ### Deprecated 127 | 128 | - Nothing. 129 | 130 | ### Removed 131 | 132 | - Nothing. 133 | 134 | ### Fixed 135 | 136 | - Nothing. 137 | 138 | ## V9.0.0 - 2022-09-24 139 | 140 | ### Added 141 | 142 | - Nothing. 143 | 144 | ### Changed 145 | 146 | - [#55](https://github.com/elie29/zend-di-config/issues/55) PHP8.1 Compatibility 147 | 148 | ### Deprecated 149 | 150 | - Nothing. 151 | 152 | ### Removed 153 | 154 | - Nothing. 155 | 156 | ### Fixed 157 | 158 | - Nothing. 159 | 160 | ## V8.1.1 - 2002-03-14 161 | 162 | ### Added 163 | 164 | - Nothing. 165 | 166 | ### Changed 167 | 168 | - [#52](https://github.com/elie29/zend-di-config/issues/52) Container compilation and delegators 169 | 170 | ### Deprecated 171 | 172 | - Nothing. 173 | 174 | ### Removed 175 | 176 | - Nothing. 177 | 178 | ### Fixed 179 | 180 | - Nothing. 181 | 182 | ## V8.1.0 - 2021-12-16 183 | 184 | ### Added 185 | 186 | - [#49](https://github.com/elie29/zend-di-config/issues/49) Support writing proxy classes to files 187 | 188 | ### Changed 189 | 190 | - Nothing. 191 | 192 | ### Deprecated 193 | 194 | - Nothing. 195 | 196 | ### Removed 197 | 198 | - Nothing. 199 | 200 | ### Fixed 201 | 202 | - Nothing. 203 | 204 | ## V8.0.0 - 2021-03-23 205 | 206 | - V8.0+ supports only PHP8+ and drops other versions 207 | 208 | ### Added 209 | 210 | - Nothing. 211 | 212 | ### Changed 213 | 214 | - [#46](https://github.com/elie29/zend-di-config/issues/46) migration to php 8 [Break Change] 215 | 216 | ### Deprecated 217 | 218 | - Nothing. 219 | 220 | ### Removed 221 | 222 | - Nothing. 223 | 224 | ### Fixed 225 | 226 | - Nothing. 227 | 228 | ## V6.0.1 - 2021-03-21 229 | 230 | ### Added 231 | 232 | - ./composer require composer/package-versions-deprecated for 7.1 backward compatibility 233 | - delete sudo from .travis 234 | - Correct ConfigTest.php 235 | - .composer self-update 236 | 237 | ### Changed 238 | 239 | - Nothing. 240 | 241 | ### Deprecated 242 | 243 | - Nothing. 244 | 245 | ### Removed 246 | 247 | - Nothing. 248 | 249 | ### Fixed 250 | 251 | - Nothing. 252 | 253 | ## V6.0.0 - 2020-01-15 254 | 255 | ### Added 256 | 257 | - Nothing. 258 | 259 | ### Changed 260 | 261 | - [#43](https://github.com/elie29/zend-di-config/issues/43) migrate to laminas framework. 262 | 263 | ### Deprecated 264 | 265 | - Nothing. 266 | 267 | ### Removed 268 | 269 | - Nothing. 270 | 271 | ### Fixed 272 | 273 | - Nothing. 274 | 275 | ## V5.0.0 - 2019-11-27 276 | 277 | ### Added 278 | 279 | - Nothing. 280 | 281 | ### Changed 282 | 283 | - [#42](https://github.com/elie29/zend-di-config/issues/42) Delete container-interop/container-interop. 284 | 285 | ### Deprecated 286 | 287 | - Nothing. 288 | 289 | ### Removed 290 | 291 | - Nothing. 292 | 293 | ### Fixed 294 | 295 | - Nothing. 296 | 297 | ## V4.0.5 - 2019-11-27 298 | 299 | ### Added 300 | 301 | - Nothing. 302 | 303 | ### Changed 304 | 305 | - [#41](https://github.com/elie29/zend-di-config/issues/41) Make overridden delegator idempotent. 306 | 307 | ### Deprecated 308 | 309 | - Nothing. 310 | 311 | ### Removed 312 | 313 | - Nothing. 314 | 315 | ### Fixed 316 | 317 | - Nothing. 318 | 319 | ## V4.0.4 - 2019-09-29 320 | 321 | ### Added 322 | 323 | - Nothing. 324 | 325 | ### Changed 326 | 327 | - [#40](https://github.com/elie29/zend-di-config/issues/40) Update composer. 328 | 329 | ### Deprecated 330 | 331 | - Nothing. 332 | 333 | ### Removed 334 | 335 | - Nothing. 336 | 337 | ### Fixed 338 | 339 | - Nothing. 340 | 341 | ## V4.0.3 - 2019-02-13 342 | 343 | ### Added 344 | 345 | - Nothing. 346 | 347 | ### Changed 348 | 349 | - Nothing. 350 | 351 | ### Deprecated 352 | 353 | - Nothing. 354 | 355 | ### Removed 356 | 357 | - Nothing. 358 | 359 | ### Fixed 360 | 361 | - [#38](https://github.com/elie29/zend-di-config/issues/38) Circular dependency detected. 362 | 363 | ## V4.0.2 - 2018-12-24 364 | 365 | ### Added 366 | 367 | - [#35](https://github.com/elie29/zend-di-config/issues/35) Allow to disable use autowire. 368 | - [#34](https://github.com/elie29/zend-di-config/issues/34) Add 7.3 support to travis. CS_CHECK needs 369 | zend-coding-standard to migrate to 2.0.0 370 | 371 | ### Changed 372 | 373 | - [#36](https://github.com/elie29/zend-di-config/issues/36) Launch composer update. 374 | 375 | ### Deprecated 376 | 377 | - Nothing. 378 | 379 | ### Removed 380 | 381 | - Nothing. 382 | 383 | ### Fixed 384 | 385 | - Nothing. 386 | 387 | ## V4.0.1 - 2018-11-07 388 | 389 | This is the complete change log. You can also read the [migration guide](docs/migration-4.0.md) for upgrading. 390 | 391 | ### Added 392 | 393 | - Nothing. 394 | 395 | ### Changed 396 | 397 | - [#28](https://github.com/elie29/zend-di-config/issues/28) Consider to change namespace (BC). 398 | - [#31](https://github.com/elie29/zend-di-config/issues/31) Zend\Di namespace. 399 | 400 | ### Deprecated 401 | 402 | - Nothing. 403 | 404 | ### Removed 405 | 406 | - Nothing. 407 | 408 | ### Fixed 409 | 410 | - Nothing. 411 | 412 | ## V3.0.9 - 2018-10-31 413 | 414 | ### Added 415 | 416 | - [#25](https://github.com/elie29/zend-di-config/issues/25) Use Expressive Skeleton installer with PHP-DI results in 417 | error. 418 | 419 | ### Changed 420 | 421 | - [#26](https://github.com/elie29/zend-di-config/issues/26) Indicate visibility of constants. 422 | 423 | ### Deprecated 424 | 425 | - Nothing. 426 | 427 | ### Removed 428 | 429 | - Nothing. 430 | 431 | ### Fixed 432 | 433 | - Nothing. 434 | 435 | ## V3.0.8 - 2018-10-19 436 | 437 | ### Added 438 | 439 | - Nothing. 440 | 441 | ### Changed 442 | 443 | - [#24](https://github.com/elie29/zend-di-config/issues/24) Config::configureContainer improvements. 444 | 445 | ### Deprecated 446 | 447 | - Nothing. 448 | 449 | ### Removed 450 | 451 | - Nothing. 452 | 453 | ### Fixed 454 | 455 | - Nothing. 456 | 457 | ## V3.0.7 - 2018-10-16 458 | 459 | ### Added 460 | 461 | - [#21](https://github.com/elie29/zend-di-config/issues/21) Add contributing.md document. 462 | - [#23](https://github.com/elie29/zend-di-config/issues/23) Launch composer update. 463 | 464 | ### Changed 465 | 466 | - Nothing. 467 | 468 | ### Deprecated 469 | 470 | - Nothing. 471 | 472 | ### Removed 473 | 474 | - Nothing. 475 | 476 | ### Fixed 477 | 478 | - Nothing. 479 | 480 | ## V3.0.6 - 2018-10-08 481 | 482 | ### Added 483 | 484 | - [#22](https://github.com/elie29/zend-di-config/issues/22) Include PHP Static Analysis Tool. 485 | 486 | ### Changed 487 | 488 | - Nothing. 489 | 490 | ### Deprecated 491 | 492 | - Nothing. 493 | 494 | ### Removed 495 | 496 | - Nothing. 497 | 498 | ### Fixed 499 | 500 | - Nothing. 501 | 502 | ## V3.0.5 - 2018-09-12 503 | 504 | ### Added 505 | 506 | - [#20](https://github.com/elie29/zend-di-config/issues/20) Makes invokables an array of services. 507 | 508 | ### Changed 509 | 510 | - Nothing. 511 | 512 | ### Deprecated 513 | 514 | - Nothing. 515 | 516 | ### Removed 517 | 518 | - Nothing. 519 | 520 | ### Fixed 521 | 522 | - Nothing. 523 | 524 | ## V3.0.4 - 2018-09-10 525 | 526 | ### Added 527 | 528 | - [#19](https://github.com/elie29/zend-di-config/issues/19) Add documentation for the cli command. 529 | 530 | ### Changed 531 | 532 | - Nothing. 533 | 534 | ### Deprecated 535 | 536 | - Nothing. 537 | 538 | ### Removed 539 | 540 | - Nothing. 541 | 542 | ### Fixed 543 | 544 | - Nothing. 545 | 546 | ## V3.0.3 - 2018-06-06 547 | 548 | ### Added 549 | 550 | - [#17](https://github.com/elie29/zend-di-config/issues/17) Add documentation for the cli command. 551 | 552 | ### Changed 553 | 554 | - Nothing. 555 | 556 | ### Deprecated 557 | 558 | - Nothing. 559 | 560 | ### Removed 561 | 562 | - Nothing. 563 | 564 | ### Fixed 565 | 566 | - Nothing. 567 | 568 | ## V3.0.2 - 2018-06-05 569 | 570 | ### Added 571 | 572 | - [#16](https://github.com/elie29/zend-di-config/issues/16) Add entries to .gitattributes. 573 | 574 | ### Changed 575 | 576 | - Nothing. 577 | 578 | ### Deprecated 579 | 580 | - Nothing. 581 | 582 | ### Removed 583 | 584 | - Nothing. 585 | 586 | ### Fixed 587 | 588 | - Nothing. 589 | 590 | ## V3.0.1 - 2018-06-05 591 | 592 | ### Added 593 | 594 | - [#14](https://github.com/elie29/zend-di-config/issues/14) Add .gitattributes file to exclude files from release. 595 | 596 | ### Changed 597 | 598 | - Nothing. 599 | 600 | ### Deprecated 601 | 602 | - Nothing. 603 | 604 | ### Removed 605 | 606 | - Nothing. 607 | 608 | ### Fixed 609 | 610 | - Nothing. 611 | 612 | ## V3.0.0 - 2018-06-05 613 | 614 | ### Added 615 | 616 | - [#12](https://github.com/elie29/zend-di-config/issues/12) Expose a CLI command for adding an autowires entry to 617 | configuration. 618 | 619 | ### Changed 620 | 621 | - [#11](https://github.com/elie29/zend-di-config/issues/11) autowires configuration should accept a straight array and 622 | not an associative key pair value. Any aliases needed should be created in the aliases configuration. 623 | 624 | ### Deprecated 625 | 626 | - Nothing. 627 | 628 | ### Removed 629 | 630 | - Nothing. 631 | 632 | ### Fixed 633 | 634 | - Nothing. 635 | 636 | ## V2.0.2 - 2018-06-04 637 | 638 | ### Added 639 | 640 | - Nothing. 641 | 642 | ### Changed 643 | 644 | - [#9](https://github.com/elie29/zend-di-config/issues/9) Config class should use config constant instead of using 645 | config key. 646 | 647 | ### Deprecated 648 | 649 | - Nothing. 650 | 651 | ### Removed 652 | 653 | - Nothing. 654 | 655 | ### Fixed 656 | 657 | - Nothing. 658 | 659 | ## V2.0.1 - 2018-06-02 660 | 661 | ### Added 662 | 663 | - [#8](https://github.com/elie29/zend-di-config/issues/8) Updated composer. 664 | - [#7](https://github.com/elie29/zend-di-config/issues/7) Renamed test folder. 665 | 666 | ### Changed 667 | 668 | - Nothing. 669 | 670 | ### Deprecated 671 | 672 | - Nothing. 673 | 674 | ### Removed 675 | 676 | - Nothing. 677 | 678 | ### Fixed 679 | 680 | - Nothing. 681 | 682 | ## V2.0.0 - 2018-05-31 683 | 684 | ### Added 685 | 686 | - [#6](https://github.com/elie29/zend-di-config/issues/6) New autowire key support to ConfigProvider. 687 | - [#5](https://github.com/elie29/zend-di-config/issues/5) Travis coverage. 688 | 689 | ### Changed 690 | 691 | - [#4](https://github.com/elie29/zend-di-config/issues/4) Change travis for code coverage. 692 | 693 | ### Deprecated 694 | 695 | - Nothing. 696 | 697 | ### Removed 698 | 699 | - Nothing. 700 | 701 | ### Fixed 702 | 703 | - [#3](https://github.com/elie29/zend-di-config/issues/3) DI_CACHE_PATH isn't recognized. 704 | - [#2](https://github.com/elie29/zend-di-config/issues/2) Added config key to the definition array. 705 | - [#1](https://github.com/elie29/zend-di-config/issues/1) Invokable class created with autowire function. 706 | --------------------------------------------------------------------------------