Closed alganet closed 11 years ago
I think this is the fix you are looking for:
Given config
my_string = 'Hey you!'
[hello Respect\Config\MyLazyLoadedHelloWorld]
string = [my_string]
[consumer Respect\Config\MyLazyLoadedHelloWorldConsumer]
hello = [hello]
The following lazy load manipulation can be performed. (referred to internally as the overriding of configuration by container state)
$expected = 'Hello World!';
$container = new Container($config);
$container->my_string = $expected;
$this->assertEquals($expected, (string) $container->hello);
$container = new Container($config);
$container->{"hello Respect\\Config\\MyLazyLoadedHelloWorld"} = array('string' => $expected);
$this->assertEquals($expected, (string) $container->hello);
$container = new Container($config);
$container->hello = new MyLazyLoadedHelloWorld($expected);
$this->assertEquals($expected, (string) $container->hello);
I think these are useful none the less but @alganet please confirm if it also addresses this issue.
Nice! It addresses =)
Closed on confirmed success
When an instantiator is passed to another instance by parameter (and possibly by other ways) it isn't being instantiated. This was introduced after 0.3.1.