diff --git a/src/Barryvdh/Reflection/DocBlock/Type/Collection.php b/src/Barryvdh/Reflection/DocBlock/Type/Collection.php index 585ccde..5a81347 100644 --- a/src/Barryvdh/Reflection/DocBlock/Type/Collection.php +++ b/src/Barryvdh/Reflection/DocBlock/Type/Collection.php @@ -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; } diff --git a/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php index 9664ec3..6d8a508 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php @@ -283,6 +283,14 @@ class CollectionTest extends TestCase 'iterable', array('iterable') ), + array( + 'callable', + array('callable') + ), + array( + 'callable(int, string): int', + array('callable(int, string): int') + ) ); }