From b9866e1d2eefbb03f60ff798e0da6948ccd39201 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 19 Oct 2014 19:31:12 +0700 Subject: [PATCH 1/4] remove PHP_VERSION_ID check before 50323 --- src/ServiceManager.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ServiceManager.php b/src/ServiceManager.php index 74129fdd..09a794a0 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -1200,14 +1200,7 @@ 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 false; } /** From bf226e8c9821d3ffed91432152bcaaab9e2478c3 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 19 Oct 2014 19:45:40 +0700 Subject: [PATCH 2/4] fixes cs for unused use ReflectionClass --- src/ServiceManager.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ServiceManager.php b/src/ServiceManager.php index 09a794a0..d71d26b2 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -9,8 +9,6 @@ namespace Zend\ServiceManager; -use ReflectionClass; - class ServiceManager implements ServiceLocatorInterface { /**@#+ From f0a95cf3a4d0eef47e925ee31b91b3b94559c8c5 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 25 Nov 2014 05:52:44 +0700 Subject: [PATCH 3/4] return is_subclass_of directly --- src/ServiceManager.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ServiceManager.php b/src/ServiceManager.php index d71d26b2..9abbacbc 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -1195,10 +1195,7 @@ protected function createDelegatorFromFactory($canonicalName, $requestedName) */ protected static function isSubclassOf($className, $type) { - if (is_subclass_of($className, $type)) { - return true; - } - return false; + return is_subclass_of($className, $type); } /** From 12492f0fe097eff4b41a104a3934bcb277f8f81c Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 27 Nov 2014 00:59:50 +0100 Subject: [PATCH 4/4] zendframework/zf2#6785 - using `is_subclass_of()` instead of protected static method usage See bug https://bugs.php.net/bug.php?id=53727 See bug https://github.com/zendframework/zf2/pull/1807 Deprecating protected static polyfill method `isSubclassOf` --- src/ServiceManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ServiceManager.php b/src/ServiceManager.php index 9abbacbc..8bb99ba2 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -1187,6 +1187,8 @@ protected function createDelegatorFromFactory($canonicalName, $requestedName) * @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