From db3fcb45d6bafcb1f4bcf25a6876d400c76ce0da Mon Sep 17 00:00:00 2001 From: "steve.brazier" Date: Wed, 27 Nov 2013 08:49:03 +0000 Subject: [PATCH] remove callable typehint as this is not in php 5.3 --- PHPCI/Plugin/Util/Factory.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PHPCI/Plugin/Util/Factory.php b/PHPCI/Plugin/Util/Factory.php index 4e6065e6..09cd44cf 100644 --- a/PHPCI/Plugin/Util/Factory.php +++ b/PHPCI/Plugin/Util/Factory.php @@ -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;