layout | title | author | date |
---|---|---|---|
blogpost |
PHP-DI 3.4 released |
Matthieu Napoli |
September 24th 2013 |
I am happy to announce that PHP-DI version 3.4 has just been released.
This time, several small improvements:
- You can now define arrays of values thanks to @unkind
Here is an example using YAML:
value4:
- [email protected]
- [email protected]
Note that the arrays can't be associative arrays, and must not be empty.
ContainerBuilder
is now fluent thanks to @drdamour:
$builder = new ContainerBuilder();
$builder->useReflection(false)
->useAnotations(true)
->setCache( ...cache );
- Support for optional parameters (before 3.4, PHP-DI required that they were defined):
public function __construct($name = 'foo')
If the $name
parameter is not defined, then its default value will be used, just like a standard PHP method call.
Read all the changes and their authors in the change log.