mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-17 17:47:13 +00:00
Fixed callable types parsing (#26)
This commit is contained in:
@@ -205,6 +205,11 @@ class Collection extends \ArrayObject
|
||||
return $type;
|
||||
}
|
||||
|
||||
// Check for callable types
|
||||
if (preg_match('/\(.*?(?=\:)/', $type)) {
|
||||
return $type;
|
||||
}
|
||||
|
||||
if($type[0] === '(') {
|
||||
return $type;
|
||||
}
|
||||
|
||||
@@ -283,6 +283,14 @@ class CollectionTest extends TestCase
|
||||
'iterable<string>',
|
||||
array('iterable<string>')
|
||||
),
|
||||
array(
|
||||
'callable',
|
||||
array('callable')
|
||||
),
|
||||
array(
|
||||
'callable(int, string): int',
|
||||
array('callable(int, string): int')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user