Skip to content

Commit

Permalink
Applying fix for callable reflection on type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Mar 30, 2013
1 parent 7334a7c commit 29282fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/Zend/Code/Generator/ParameterGenerator.php
Expand Up @@ -56,6 +56,8 @@ public static function fromReflection(ParameterReflection $reflectionParameter)

if ($reflectionParameter->isArray()) {
$param->setType('array');
} elseif (method_exists($reflectionParameter, 'isCallable') && $reflectionParameter->isCallable()) {
$param->setType('callable');
} else {
$typeClass = $reflectionParameter->getClass();
if ($typeClass) {
Expand Down
2 changes: 2 additions & 0 deletions library/Zend/Code/Reflection/ParameterReflection.php
Expand Up @@ -77,6 +77,8 @@ public function getType()
{
if ($this->isArray()) {
return 'array';
} elseif (method_exists($this, 'isCallable') && $this->isCallable()) {
return 'callable';
}

if (($class = $this->getClass()) instanceof \ReflectionClass) {
Expand Down

0 comments on commit 29282fe

Please sign in to comment.