From dba11a91bbc1f0c3de7a46429dd7c2c0682ee645 Mon Sep 17 00:00:00 2001 From: David Yell Date: Wed, 24 Jun 2015 11:58:43 +0100 Subject: [PATCH 1/3] Updated the class names in the doc blocks --- src/AccessibilityHelperTrait.php | 7 +++++-- src/CounterHelperTrait.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/AccessibilityHelperTrait.php b/src/AccessibilityHelperTrait.php index 263be07..4188dce 100644 --- a/src/AccessibilityHelperTrait.php +++ b/src/AccessibilityHelperTrait.php @@ -1,6 +1,7 @@ _getReflectionTargetClass($class); if (empty($this->_reflectionInstanceCache[$class])) { - throw new \Exception(sprintf('Unable to find instance of %s in the reflection cache. Have you added it using "setReflectionClassInstance"?', $class)); + throw new Exception(sprintf('Unable to find instance of %s in the reflection cache. Have you added it using "setReflectionClassInstance"?', $class)); } return $this->_reflectionInstanceCache[$class]; @@ -145,12 +147,13 @@ protected function _getReflectionPropertyInstance($property, $class) { * * @param string $class * @return string + * @throws Exception */ protected function _getReflectionTargetClass($class) { $class = $class ?: $this->defaultReflectionTarget; if (!$class) { - throw new \Exception('Unable to find reflection target; have you set $defaultReflectionTarget or passed in a class name?'); + throw new Exception('Unable to find reflection target; have you set $defaultReflectionTarget or passed in a class name?'); } if (!is_object($class)) { diff --git a/src/CounterHelperTrait.php b/src/CounterHelperTrait.php index bb914a8..5674036 100644 --- a/src/CounterHelperTrait.php +++ b/src/CounterHelperTrait.php @@ -25,7 +25,7 @@ trait CounterHelperTrait { * Permits using multiple named counters * * @param mixed $name string or object - * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex + * @return \PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex */ public function next($name = '') { if (is_object($name)) { From 5a5fac872b6800dfa4ae3cf223122df23f197f8e Mon Sep 17 00:00:00 2001 From: David Yell Date: Wed, 24 Jun 2015 11:59:38 +0100 Subject: [PATCH 2/3] Added a missing linebreak --- src/AccessibilityHelperTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AccessibilityHelperTrait.php b/src/AccessibilityHelperTrait.php index 4188dce..be136f3 100644 --- a/src/AccessibilityHelperTrait.php +++ b/src/AccessibilityHelperTrait.php @@ -1,6 +1,7 @@ Date: Wed, 24 Jun 2015 14:00:41 +0100 Subject: [PATCH 3/3] Update AccessibilityHelperTrait.php --- src/AccessibilityHelperTrait.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/AccessibilityHelperTrait.php b/src/AccessibilityHelperTrait.php index be136f3..4b21e2a 100644 --- a/src/AccessibilityHelperTrait.php +++ b/src/AccessibilityHelperTrait.php @@ -3,6 +3,8 @@ namespace FriendsOfCake\TestUtilities; use Exception; +use ReflectionProperty; +use ReflectionMethod; /** * @@ -68,7 +70,7 @@ public function setReflectionClassInstance($instance, $class = null) { * * @param string $class * @return Object - * @throws Exception + * @throws \Exception */ public function getReflectionInstance($class) { $class = $this->_getReflectionTargetClass($class); @@ -148,7 +150,7 @@ protected function _getReflectionPropertyInstance($property, $class) { * * @param string $class * @return string - * @throws Exception + * @throws \Exception */ protected function _getReflectionTargetClass($class) { $class = $class ?: $this->defaultReflectionTarget; @@ -172,7 +174,7 @@ protected function _getReflectionTargetClass($class) { * @return \ReflectionMethod */ protected function _getNewReflectionMethod($class, $method) { - return new \ReflectionMethod($class, $method); + return new ReflectionMethod($class, $method); } /** @@ -183,6 +185,6 @@ protected function _getNewReflectionMethod($class, $method) { * @return \ReflectionProperty */ protected function _getNewReflectionProperty($class, $property) { - return new \ReflectionProperty($class, $property); + return new ReflectionProperty($class, $property); } }