mnapoli / assembly

[EXPERIMENTAL] Implementation of container-interop/definition-interop
MIT License
7 stars 5 forks source link

Add ability to build ObjectDefinition with constructor arguments #10

Closed Anahkiasen closed 9 years ago

Anahkiasen commented 9 years ago

Unless the class being built is very simply you always need to pass constructor arguments which means you always have to do (new ObjectDefinition($identifier, SomeClass::class))->setConstructorArguments($arguments) – which is rather lengthy. Now you can just do new ObjectDefinition($identifier, SomeClass::class, $arguments).

With the removal of identifiers this even brings it down to new ObjectDefinition(SomeClass::class, $arguments) which almost negates the need for an object() function considering how short it is.

mnapoli commented 9 years ago

:+1: