Closed
Description
from #168
class Foo
{
public function __construct(Bar $bar = null)
{
$this->bar = $bar ?: $this->createDefaultBar();
}
}
Today, by default PHP-DI will inject a Bar
instance (because of autowiring). It should instead inject the default value, unless specified otherwise.
Fixing this will be a small BC break, but I think it's a necessary evil since it's quite problematic.