code-lts / doctum

A php API documentation generator, fork of Sami
https://doctum.long-term.support/
MIT License
300 stars 32 forks source link

Error when parsing @throws #35

Closed fjgarlin closed 3 years ago

fjgarlin commented 3 years ago

When parsing the @throws tag without summary like here

   * @throws \InvalidArgumentException.
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException.

the application throws the following exception:

In class.twig line 316:
  An exception has been thrown during the rendering of a template ("Warning: Cannot assign an empty string to a string offset in phar:///.../doctum.phar/src/Reflection/MethodReflection.php line 106").                                                                                                          

In ErrorHandler.php line 42:
  Warning: Cannot assign an empty string to a string offset in phar:///.../doctum.phar/src/Reflection/MethodReflection.php line 106

and does not finish the documentation generation.

williamdes commented 3 years ago

Thank you for the report and for the fix @fjgarlin !

williamdes commented 3 years ago

I added tests in b18c7b7ebc4bd896af195f7a1e86e5b9cb58f5a6 and 5.3 series are non affected, the fix will target 5.4 series