From a917da5674a4c81bd1fa6ca0c2762442ce7eabf6 Mon Sep 17 00:00:00 2001 From: Joris van de Sande Date: Thu, 22 Jul 2010 20:03:49 +0000 Subject: [PATCH] - Added parameter and return value documentation for ReflectionMethod constructor - Updated documentation and added examples for the following ReflectionMethod methods: export, getDeclaringClass, getPrototype, invoke, invokeArgs, isDestructor, __toString git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301478 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../reflection/reflectionmethod/construct.xml | 21 ++++--- .../reflection/reflectionmethod/export.xml | 3 +- .../reflectionmethod/getdeclaringclass.xml | 44 ++++++++++++-- .../reflectionmethod/getmodifiers.xml | 60 +++++++++++++++++-- .../reflectionmethod/getprototype.xml | 53 ++++++++++++++-- .../reflection/reflectionmethod/invoke.xml | 33 +++++++++- .../reflectionmethod/invokeargs.xml | 33 +++++++++- .../reflectionmethod/isdestructor.xml | 4 +- .../reflection/reflectionmethod/tostring.xml | 47 +++++++++++++-- 9 files changed, 259 insertions(+), 39 deletions(-) diff --git a/reference/reflection/reflectionmethod/construct.xml b/reference/reflection/reflectionmethod/construct.xml index 14765da637..28bfb912ac 100644 --- a/reference/reflection/reflectionmethod/construct.xml +++ b/reference/reflection/reflectionmethod/construct.xml @@ -11,15 +11,13 @@ &reftitle.description; ReflectionMethod::__construct - stringclass_or_method - stringname + mixedclass + stringname Constructs a new ReflectionMethod. - &warn.undocumented.func; - @@ -27,10 +25,10 @@ - class_or_method + class - + Classname or object (instance of the class) that contains the method. @@ -38,7 +36,7 @@ name - + Name of the method. @@ -49,7 +47,14 @@ &reftitle.returnvalues; - + &return.void; + + + + + &reftitle.errors; + + A ReflectionException if the the given method does not exist. diff --git a/reference/reflection/reflectionmethod/export.xml b/reference/reflection/reflectionmethod/export.xml index 29de88563b..c35e2caffd 100644 --- a/reference/reflection/reflectionmethod/export.xml +++ b/reference/reflection/reflectionmethod/export.xml @@ -4,7 +4,7 @@ ReflectionMethod::export - Export + Export a reflection method. @@ -67,6 +67,7 @@ ReflectionMethod::__construct + ReflectionMethod::__toString diff --git a/reference/reflection/reflectionmethod/getdeclaringclass.xml b/reference/reflection/reflectionmethod/getdeclaringclass.xml index a1cb857a8e..f767ce019d 100644 --- a/reference/reflection/reflectionmethod/getdeclaringclass.xml +++ b/reference/reflection/reflectionmethod/getdeclaringclass.xml @@ -4,7 +4,7 @@ ReflectionMethod::getDeclaringClass - Gets declaring class + Gets declaring class for the reflected method. @@ -14,11 +14,8 @@ - Gets the declaring class. + Gets the declaring class for the reflected method. - - &warn.undocumented.func; - @@ -29,7 +26,42 @@ &reftitle.returnvalues; - A ReflectionClass. + A ReflectionClass object of the class that the + reflected method is part of. + + + + + &reftitle.examples; + + + <methodname>ReflectionFunction::getDeclaringClass</methodname> example + +getDeclaringClass()); +?> +]]> + + &example.outputs; + + + string(10) "HelloWorld" +} +]]> + + diff --git a/reference/reflection/reflectionmethod/getmodifiers.xml b/reference/reflection/reflectionmethod/getmodifiers.xml index df1e449088..d80cbf5b4c 100644 --- a/reference/reflection/reflectionmethod/getmodifiers.xml +++ b/reference/reflection/reflectionmethod/getmodifiers.xml @@ -4,7 +4,7 @@ ReflectionMethod::getModifiers - Gets modifiers + Gets the method modifiers @@ -14,11 +14,8 @@ - Gets the modifiers. + Gets the method modifiers. - - &warn.undocumented.func; - @@ -29,7 +26,58 @@ &reftitle.returnvalues; - A numeric representation of the modifiers. + A numeric representation of the modifiers. The modifiers are listed below. + The actual meanings of these modifiers are described in the + predefined constants. + + ReflectionMethod modifiers + + + + value + constant + + + + + 1 + + ReflectionMethod::IS_STATIC + + + + 2 + + ReflectionMethod::IS_ABSTRACT + + + + 4 + + ReflectionMethod::IS_FINAL + + + + 256 + + ReflectionMethod::IS_PUBLIC + + + + 512 + + ReflectionMethod::IS_PROTECTED + + + + 1024 + + ReflectionMethod::IS_PRIVATE + + + + +
diff --git a/reference/reflection/reflectionmethod/getprototype.xml b/reference/reflection/reflectionmethod/getprototype.xml index 62bd7639af..59f6b3e5c9 100644 --- a/reference/reflection/reflectionmethod/getprototype.xml +++ b/reference/reflection/reflectionmethod/getprototype.xml @@ -4,21 +4,19 @@ ReflectionMethod::getPrototype - Gets prototype + Gets the method prototype (if there is one). &reftitle.description; - public voidReflectionMethod::getPrototype + public ReflectionMethodReflectionMethod::getPrototype - Gets the methods prototype. + Returns the methods prototype. - &warn.undocumented.func; - @@ -29,7 +27,7 @@ &reftitle.returnvalues; - The prototype. + A ReflectionMethod instance of the method prototype. @@ -41,6 +39,49 @@
+ + &reftitle.examples; + + + <methodname>ReflectionMethod::getPrototype</methodname> example + +getPrototype()); +?> +]]> + + &example.outputs; + + + string(10) "sayHelloTo" + ["class"]=> + string(5) "Hello" +} +]]> + + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionmethod/invoke.xml b/reference/reflection/reflectionmethod/invoke.xml index efd63a32c3..27ed87f1d7 100644 --- a/reference/reflection/reflectionmethod/invoke.xml +++ b/reference/reflection/reflectionmethod/invoke.xml @@ -19,8 +19,6 @@ Invokes a reflected method. - &warn.undocumented.func; - @@ -67,6 +65,37 @@ + + &reftitle.examples; + + + <methodname>ReflectionFunction::invoke</methodname> example + +invoke(new HelloWorld(), 'Mike'); +?> +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionmethod/invokeargs.xml b/reference/reflection/reflectionmethod/invokeargs.xml index afcb3557b9..d71ecc1930 100644 --- a/reference/reflection/reflectionmethod/invokeargs.xml +++ b/reference/reflection/reflectionmethod/invokeargs.xml @@ -18,8 +18,6 @@ Invoke arguments. - &warn.undocumented.func; - @@ -65,6 +63,37 @@ + + &reftitle.examples; + + + <methodname>ReflectionFunction::invokeArgs</methodname> example + +invokeArgs(new HelloWorld(), array('Mike')); +?> +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionmethod/isdestructor.xml b/reference/reflection/reflectionmethod/isdestructor.xml index 6f5bb15b39..9899ea7aa3 100644 --- a/reference/reflection/reflectionmethod/isdestructor.xml +++ b/reference/reflection/reflectionmethod/isdestructor.xml @@ -14,7 +14,7 @@ - Checks if the method is a destructor. + Checks if the method is a destructor. @@ -26,7 +26,7 @@ &reftitle.returnvalues; - &true; if the method is a destructor, otherwise false; + &true; if the method is a destructor, otherwise &false; diff --git a/reference/reflection/reflectionmethod/tostring.xml b/reference/reflection/reflectionmethod/tostring.xml index e25bf8f47f..1043403dbd 100644 --- a/reference/reflection/reflectionmethod/tostring.xml +++ b/reference/reflection/reflectionmethod/tostring.xml @@ -4,7 +4,7 @@ ReflectionMethod::__toString - To string + Returns the string representation of the Reflection method object. @@ -14,11 +14,8 @@ - To string. + Returns the string representation of the Reflection method object. - - &warn.undocumented.func; - @@ -29,7 +26,45 @@ &reftitle.returnvalues; - + A string representation of this ReflectionMethod instance. + + + + + &reftitle.examples; + + + <methodname>ReflectionFunction::__toString</methodname> example + + +]]> + + &example.outputs; + + public method sayHelloTo ] { + @@ /var/www/examples/reflection.php 16 - 18 + + - Parameters [1] { + Parameter #0 [ $name ] + } +} + +]]> + +