PHP 5.2 Dependency Injection Container 06

An addition for a clearer interface to the dependency injection container.

The standing possibility

I have classes with dumb constructors requiring a certain set up procedure to be carried out after each object instantiation like this

$obj = new Object();
$obj->setPropertyOne('one');
$obj->setPropertyTwo('two');

The actual implementation of the dependency injection container allows for registration of this kind of object construction using the below syntax

$c = new tad_DI52_Container();
$c->set_ctor('object', 'Object')
    ->setPropertyOne('one')
    ->setPropertyTwo('two');

and leverages the power of the __call magic method to allow the fetch of the object instance not changing its API

$object = $c->make('object');

// exactly like this
$obj = new Object();
$obj->setPropertyOne('one');
$obj->setPropertyTwo('two');

The new possibility

I’ve found my code can become confusing quickly using the magic call methods above and, not removing that possibility, I’ve added the call_method method to the class that allows reproducing the example above with this syntax

$c = new tad_DI52_Container();
$c->set_ctor('object', 'Object')
    ->call_method('setPropertyOne', 'one')
    ->call_method('setPropertyTwo', 'two');

A little longer but way clearer.

I appreciate your input