*/
class ResourceCheckerConfigCacheFactory implements ConfigCacheFactoryInterface
{
- /**
- * @var ResourceCheckerInterface[]
- */
private $resourceCheckers = array();
/**
- * @param ResourceCheckerInterface[] $resourceCheckers
+ * @param iterable|ResourceCheckerInterface[] $resourceCheckers
*/
- public function __construct(array $resourceCheckers = array())
+ public function __construct($resourceCheckers = array())
{
$this->resourceCheckers = $resourceCheckers;
}
*/
public function cache($file, $callback)
{
- if (!is_callable($callback)) {
- throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', gettype($callback)));
+ if (!\is_callable($callback)) {
+ throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback)));
}
$cache = new ResourceCheckerConfigCache($file, $this->resourceCheckers);
if (!$cache->isFresh()) {
- call_user_func($callback, $cache);
+ \call_user_func($callback, $cache);
}
return $cache;