markstory / sphinxcontrib-phpdomain

A PHP domain for sphinx. Allows you to annotate PHP objects in your sphinx docs.
Other
19 stars 14 forks source link

classname is NoneType in function handle_signature #2

Closed benlk closed 7 years ago

benlk commented 7 years ago

Here's the traceback: https://readthedocs.org/projects/largo/builds/4590201/

This commit removes the two files that triggered the problem, as an example of the code that was causing the build to fail: https://github.com/INN/Largo/commit/a6165984b7149932fc99cdf4fd97836aa56edb61

The main problem seems to be that, somehow, the classname is incorrectly set in PhpObject's handle_signature when it's created, around here: https://github.com/markstory/sphinxcontrib-phpdomain/blob/master/sphinxcontrib/phpdomain.py#L123

If this isn't a bug in phpdomain, or if this is the wrong spot to report bugs, please let me know.

markstory commented 7 years ago

Thanks! I'll see if I can reproduce the issue and get a fix together.

markstory commented 7 years ago

I've got a pull request up to fix the fatal error. However, even with the error being fixed your documentation will not generate correctly. You appear to be documenting a class but using directives intended for documenting global functions. Your docs should look more like.

.. This directive was missing before.
.. php:class:: Largo

.. method names don't need the class names in them.
.. php:method:: populate_variables()

    Set us up the vars