diff --git a/composer.json b/composer.json index 8e1568a..0180ceb 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "phpunit/phpunit": "~4.0", "mockery/mockery": "0.9.1", "symfony/dom-crawler": ">=2.0.4", - "phpdocumentor/reflection-docblock": "2.0.0", + "phpdocumentor/reflection-docblock": "~3.1.0", "jms/serializer": ">=0.11.0" }, "suggest": { diff --git a/src/Ladybug/Type/Object/Container.php b/src/Ladybug/Type/Object/Container.php index cf741fd..e6afbf6 100644 --- a/src/Ladybug/Type/Object/Container.php +++ b/src/Ladybug/Type/Object/Container.php @@ -372,10 +372,15 @@ protected function loadClassMethods(\ReflectionClass $reflectedObject) // phpdoc comment if (class_exists('\phpDocumentor\Reflection\DocBlock')) { - $phpdoc = new \phpDocumentor\Reflection\DocBlock($reflectedMethod->getDocComment()); + $docComment = $reflectedMethod->getDocComment(); - $method->setShortDescription($phpdoc->getShortDescription()); - $method->setLongDescription($phpdoc->getLongDescription()); + if (is_string($docComment)) { + $phpdocFactory = \phpDocumentor\Reflection\DocBlockFactory::createInstance(); + $phpdoc = $phpdocFactory->create($docComment); + + $method->setShortDescription($phpdoc->getSummary()); + $method->setLongDescription((string) $phpdoc->getDescription()); + } } // parameters