Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/AutoloaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Zend\Loader;

use ReflectionClass;
use Traversable;

if (class_exists('Zend\Loader\AutoloaderFactory')) {
Expand Down Expand Up @@ -87,7 +86,7 @@ public static function factory($options = null)
);
}

if (!static::isSubclassOf($class, 'Zend\Loader\SplAutoloader')) {
if (!is_subclass_of($class, 'Zend\Loader\SplAutoloader')) {
require_once 'Exception/InvalidArgumentException.php';
throw new Exception\InvalidArgumentException(
sprintf('Autoloader class %s must implement Zend\\Loader\\SplAutoloader', $class)
Expand Down Expand Up @@ -199,22 +198,14 @@ protected static function getStandardAutoloader()
* @see https://bugs.php.net/bug.php?id=53727
* @see https://github.com/zendframework/zf2/pull/1807
*
* @deprecated since zf 2.3 requires PHP >= 5.3.23
*
* @param string $className
* @param string $type
* @return bool
*/
protected static function isSubclassOf($className, $type)
{
if (is_subclass_of($className, $type)) {
return true;
}
if (PHP_VERSION_ID >= 50307) {
return false;
}
if (!interface_exists($type)) {
return false;
}
$r = new ReflectionClass($className);
return $r->implementsInterface($type);
return is_subclass_of($className, $type);
}
}

0 comments on commit 14c622d

Please sign in to comment.