diff --git a/doc/reference.rst b/doc/reference.rst index 35f04a8..2a64bab 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -145,11 +145,6 @@ Each directive populates the index, and or the namespace index. This is an instance method. -.. rst:directive:: .. php:staticmethod:: ClassName::methodName(signature) - - Describe a static method, its arguments, return value and exceptions, - see :rst:dir:`php:method` for options. - .. rst:directive:: .. php:property:: name Describe a property on a class. @@ -193,11 +188,9 @@ matching directive is found: .. rst:role:: php:method - Reference a method of a class/interface/trait. This role supports - both kinds of methods:: + Reference a method of a class/interface/trait:: :php:method:`DateTime::setDate` - :php:method:`Classname::staticMethod` .. rst:role:: php:property diff --git a/sphinxcontrib/phpdomain.py b/sphinxcontrib/phpdomain.py index 12a8749..8b7e629 100644 --- a/sphinxcontrib/phpdomain.py +++ b/sphinxcontrib/phpdomain.py @@ -673,7 +673,7 @@ class PhpDomain(Domain): 'const': PhpNamespacelevel, 'class': PhpClasslike, 'method': PhpClassmember, - 'staticmethod': PhpClassmember, + 'staticmethod': PhpClassmember, # deprecated, use "method" with "static" visibility, methods in PHP are exclusively static or non-static 'property': PhpClassmember, 'attr': PhpClassmember, # deprecated, use "property" 'case': PhpClassmember, diff --git a/test/log.txt b/test/log.txt index 61449fa..27a1cde 100644 --- a/test/log.txt +++ b/test/log.txt @@ -1,6 +1,6 @@ test/ns.md:48: [phpdomain.info] Target A2::simplify not found test/ns.md:53: [phpdomain.info] Target Bar2\A::simplify not found -test/rst_doc.md:502: [phpdomain.info] Target OtherLibrary\ReturningClass\int|string|OtherLibrary\ReturnedClass|LibraryName\SubPackage\SubpackageInterface|null not found +test/rst_doc.md:478: [phpdomain.info] Target OtherLibrary\ReturningClass\int|string|OtherLibrary\ReturnedClass|LibraryName\SubPackage\SubpackageInterface|null not found test/rst_doc2.md:11: [phpdomain.info] Target Imagine\Image\ImageInterface::draw not found test/rst_doc2.md:17: [phpdomain.info] Target Imagine\Image\PointInterface not found test/rst_doc2.md:17: [phpdomain.info] Target Imagine\Image\BoxInterface not found diff --git a/test/rst_doc.html b/test/rst_doc.html index 8356f2e..80b071b 100644 --- a/test/rst_doc.html +++ b/test/rst_doc.html @@ -244,21 +244,25 @@

Classes -
- - static - +
+
- OtherClass:: + OtherClass2:: - staticMethod + update - + ( + + $arg + = + '' + + ) +
-

A static method.

+

A method without explicitly declared class block.

@@ -508,9 +512,9 @@

Test Case - Global symbols with no namespaces + - OtherClass::staticMethod + OtherClass2::update

@@ -710,23 +714,6 @@

Namespaced elements -
-
- - static - - - LibraryName\LibraryClass:: - - - staticMethod - - -
-
-

A static method in a namespace

-
-
@@ -784,26 +771,23 @@

Namespaced elementsConst on class in namespace

-
-
- - static - +
+
- LibraryName\NamespaceClass:: + LibraryName\NamespaceClass2:: - namespaceStatic + update ( $foo ) - +
-

A static method here.

+

A method without explicitly declared class block in a namespace

@@ -978,13 +962,6 @@

Test Case - not including namespace - - LibraryClass::staticMethod() - - -

@@ -1034,6 +1011,13 @@

Test Case - not including namespace + + NamespaceClass2::update() + + +

@@ -1846,7 +1830,7 @@

Advanced Enumerations +
static @@ -1854,6 +1838,8 @@

Advanced Enumerations values + ( + ) diff --git a/test/rst_doc.md b/test/rst_doc.md index 7504458..1c2fab2 100644 --- a/test/rst_doc.md +++ b/test/rst_doc.md @@ -79,9 +79,9 @@ Classes This class constant wasn't indented -.. php:staticmethod:: OtherClass::staticMethod() +.. php:method:: OtherClass2::update($arg = '') - A static method. + A method without explicitly declared class block. Interfaces ========== @@ -172,7 +172,7 @@ Test Case - Global symbols with no namespaces :php:const:`OtherClass::NO_INDENT` -:php:function:`OtherClass::staticMethod` +:php:function:`OtherClass2::update` :php:interface:`DateTimeInterface` @@ -238,10 +238,6 @@ Namespaced elements A property! -.. php:staticmethod:: LibraryClass::staticMethod() - - A static method in a namespace - .. php:class:: NamespaceClass A class in the namespace, no indenting on children @@ -258,9 +254,9 @@ Namespaced elements Const on class in namespace -.. php:staticmethod:: namespaceStatic($foo) +.. php:method:: NamespaceClass2::update($foo) - A static method here. + A method without explicitly declared class block in a namespace .. php:class:: final LibraryClassFinal @@ -322,8 +318,6 @@ Within a namespace context you don't need to include the namespace in links. :php:function:`LibraryClass::instanceMethod` -:php:function:`LibraryClass::staticMethod()` - :php:property:`LibraryClass::$property` :php:const:`LibraryClass::TEST_CONST` @@ -338,6 +332,8 @@ Within a namespace context you don't need to include the namespace in links. :php:const:`NamespaceClass::NAMESPACE_CONST` +:php:method:`NamespaceClass2::update()` + :php:class:`LibraryClassFinal` :php:method:`LibraryClassFinal::firstMethod` @@ -537,7 +533,7 @@ Advanced Enumerations Returns "red" for hearts and diamonds, "black" for clubs and spades. - .. php:staticmethod:: values() -> string[] + .. php:method:: static values() -> string[] Returns an array of the values of all the cases on this enum.