Skip to content

Commit

Permalink
Merge pull request #5 from davidyell/docblocks
Browse files Browse the repository at this point in the history
Updated the doc blocks
  • Loading branch information
lorenzo committed Jun 28, 2015
2 parents 588d6f6 + a5d0e58 commit f396ff1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/AccessibilityHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace FriendsOfCake\TestUtilities;

use Exception;
use ReflectionProperty;
use ReflectionMethod;

/**
*
* Licensed under The MIT License
Expand Down Expand Up @@ -66,11 +70,12 @@ public function setReflectionClassInstance($instance, $class = null) {
*
* @param string $class
* @return Object
* @throws \Exception
*/
public function getReflectionInstance($class) {
$class = $this->_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];
Expand Down Expand Up @@ -145,12 +150,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)) {
Expand All @@ -168,7 +174,7 @@ protected function _getReflectionTargetClass($class) {
* @return \ReflectionMethod
*/
protected function _getNewReflectionMethod($class, $method) {
return new \ReflectionMethod($class, $method);
return new ReflectionMethod($class, $method);
}

/**
Expand All @@ -179,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);
}
}
2 changes: 1 addition & 1 deletion src/CounterHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit f396ff1

Please sign in to comment.