Closed mnapoli closed 8 years ago
:+1: for the @return
annotation.
But we must even be more specific, because the DefinitionProviderInterface::getDefinitions()
method cannot return "any" object implementing DefinitionInterface
, but only the objects that are implementing one of the sub-interfaces we defined in definition-interop.
What about adding these lines to the PHPDoc:
/**
* Returns the definitions to register in the container.
*
* Definitions must be indexed by their entry ID. For example:
*
* return [
* 'logger' => ...
* 'mailer' => ...
* ];
*
* Definitions MUST be objects implementing one of those interfaces:
*
* - `ObjectDefinitionInterface`
* - `FactoryCallDefinitionInterface`
* - `ParameterDefinitionInterface`
* - `ReferenceDefinitionInterface`
*
* @return DefinitionInterface[]
*/
PR updated!
:+1:
References #22
Enforce that
DefinitionProviderInterface::getDefinitions()
returns an array ofDefinitionInterface
.