remove callable typehint as this is not in php 5.3
This commit is contained in:
parent
477fd58641
commit
db3fcb45d6
1 changed files with 7 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ class Factory {
|
|||
* @throws \InvalidArgumentException
|
||||
* @internal param mixed $resource
|
||||
*/
|
||||
public function registerResource(callable $loader,
|
||||
public function registerResource($loader,
|
||||
$name = null,
|
||||
$type = null
|
||||
)
|
||||
|
|
@ -86,6 +86,12 @@ class Factory {
|
|||
);
|
||||
}
|
||||
|
||||
if (!($loader instanceof \Closure)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'$loader is expected to be a function'
|
||||
);
|
||||
}
|
||||
|
||||
$resourceID = $this->getInternalID($type, $name);
|
||||
|
||||
$this->container[$resourceID] = $loader;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue