From f9202b651d126b52612e9740af3beb84ea0977fc Mon Sep 17 00:00:00 2001 From: Justin Martin Date: Sun, 27 May 2012 23:08:29 +0000 Subject: [PATCH] Documented many undocumented ReflectionClass methods. Removed undocumented warnings from a couple of documented methods. Removed $default parameter from ReflectionClass::getStaticPropertyValue method documentation, as its behaviour is undefined and seems to exist only as an artefact. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325878 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../reflection/reflectionclass/export.xml | 54 ++++++++- .../reflectionclass/getconstructor.xml | 39 ++++++- .../reflectionclass/getextension.xml | 36 +++++- .../reflectionclass/getextensionname.xml | 32 +++++- .../reflection/reflectionclass/getmethod.xml | 35 +++++- .../reflection/reflectionclass/getmethods.xml | 107 +++++++++++++++++- .../reflectionclass/getproperty.xml | 35 +++++- .../getstaticpropertyvalue.xml | 44 ++++--- .../reflectionclass/iscloneable.xml | 41 ++++++- .../reflectionclass/isinstantiable.xml | 6 +- .../reflectionclass/isinterface.xml | 32 +++++- .../reflection/reflectionclass/isinternal.xml | 35 +++++- .../reflectionclass/newinstanceargs.xml | 29 ++++- 13 files changed, 462 insertions(+), 63 deletions(-) diff --git a/reference/reflection/reflectionclass/export.xml b/reference/reflection/reflectionclass/export.xml index 4577592afc..4a3597745b 100644 --- a/reference/reflection/reflectionclass/export.xml +++ b/reference/reflection/reflectionclass/export.xml @@ -18,8 +18,6 @@ Exports a reflected class. - &warn.undocumented.func; - @@ -52,6 +50,58 @@ &reflection.export.return; + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::export</methodname> + + +]]> + + &example.outputs.similar; + + class Apple ] { + @@ php shell code 1-8 + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ public $var1 ] + Property [ public $var2 ] + } + + - Methods [1] { + Method [ public method type ] { + @@ php shell code 5 - 7 + } + } +} +]]> + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionclass/getconstructor.xml b/reference/reflection/reflectionclass/getconstructor.xml index ca72e37706..28a0e9b612 100644 --- a/reference/reflection/reflectionclass/getconstructor.xml +++ b/reference/reflection/reflectionclass/getconstructor.xml @@ -4,21 +4,19 @@ ReflectionClass::getConstructor - Gets constructor + Gets the constructor of the class &reftitle.description; - public object ReflectionClass::getConstructor + public ReflectionMethod ReflectionClass::getConstructor - Gets the constructor from a class. + Gets the constructor of the reflected class. - &warn.undocumented.func; - @@ -29,7 +27,36 @@ &reftitle.returnvalues; - A ReflectionMethod object. + A ReflectionMethod object reflecting the class' constructor. + + + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getConstructor</methodname> + +getConstructor(); +var_dump($constructor); +?> +]]> + + &example.outputs; + + + string(11) "__construct" + ["class"]=> + string(15) "ReflectionClass" +} +]]> + + diff --git a/reference/reflection/reflectionclass/getextension.xml b/reference/reflection/reflectionclass/getextension.xml index 5e9e84b4ac..828c895e99 100644 --- a/reference/reflection/reflectionclass/getextension.xml +++ b/reference/reflection/reflectionclass/getextension.xml @@ -4,7 +4,7 @@ ReflectionClass::getExtension - Gets extension info + Gets a ReflectionExtension object for the extension which defined the class @@ -14,11 +14,9 @@ - Gets an extensions ReflectionExtension object. + Gets a ReflectionExtension object for the extension which defined the class. - &warn.undocumented.func; - @@ -29,7 +27,35 @@ &reftitle.returnvalues; - A ReflectionExtension object. + A ReflectionExtension object representing the extension which defined the class, + or &null; for user-defined classes. + + + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getExtension</methodname> + +getExtension(); +var_dump($extension); +?> +]]> + + &example.outputs; + + + string(10) "Reflection" +} +]]> + + diff --git a/reference/reflection/reflectionclass/getextensionname.xml b/reference/reflection/reflectionclass/getextensionname.xml index c354812d46..8bf07ec03f 100644 --- a/reference/reflection/reflectionclass/getextensionname.xml +++ b/reference/reflection/reflectionclass/getextensionname.xml @@ -4,7 +4,7 @@ ReflectionClass::getExtensionName - Gets an extensions name + Gets the name of the extension which defined the class @@ -14,11 +14,9 @@ - Gets an extensions name. + Gets the name of the extension which defined the class. - &warn.undocumented.func; - @@ -29,7 +27,31 @@ &reftitle.returnvalues; - The extensions name. + The name of the extension which defined the class, or &false; for user-defined classes. + + + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getExtensionName</methodname> + +getExtensionName(); +var_dump($extension); +?> +]]> + + &example.outputs; + + + + diff --git a/reference/reflection/reflectionclass/getmethod.xml b/reference/reflection/reflectionclass/getmethod.xml index 18971ebcdb..14a73f17ce 100644 --- a/reference/reflection/reflectionclass/getmethod.xml +++ b/reference/reflection/reflectionclass/getmethod.xml @@ -4,7 +4,7 @@ ReflectionClass::getMethod - Gets a ReflectionMethod + Gets a ReflectionMethod for a class method. @@ -14,11 +14,9 @@ stringname - Gets a ReflectionMethod about a method. + Gets a ReflectionMethod for a class method. - &warn.undocumented.func; - @@ -43,6 +41,35 @@ A ReflectionMethod. + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getMethod</methodname> + +getMethod('getMethod'); +var_dump($method); +?> +]]> + + &example.outputs; + + + string(9) "getMethod" + ["class"]=> + string(15) "ReflectionClass" +} +]]> + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionclass/getmethods.xml b/reference/reflection/reflectionclass/getmethods.xml index 7dbd6ed780..7cc7cef64b 100644 --- a/reference/reflection/reflectionclass/getmethods.xml +++ b/reference/reflection/reflectionclass/getmethods.xml @@ -4,7 +4,7 @@ ReflectionClass::getMethods - Gets a list of methods + Gets an array of methods @@ -14,11 +14,8 @@ stringfilter - Gets a list of methods. + Gets an array of methods for the class. - - &warn.undocumented.func; - @@ -28,6 +25,10 @@ filter + + Filter the results to include only methods with certain attributes. Defaults + to no filtering. + Any combination of ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC, @@ -45,7 +46,101 @@ &reftitle.returnvalues; - An array of methods. + An array of ReflectionMethod objects + reflecting each method. + + + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getMethods</methodname> + +getMethods(); +var_dump($methods); +?> +]]> + + &example.outputs; + + + &object(ReflectionMethod)#2 (2) { + ["name"]=> + string(11) "firstMethod" + ["class"]=> + string(5) "Apple" + } + [1]=> + &object(ReflectionMethod)#3 (2) { + ["name"]=> + string(12) "secondMethod" + ["class"]=> + string(5) "Apple" + } + [2]=> + &object(ReflectionMethod)#4 (2) { + ["name"]=> + string(11) "thirdMethod" + ["class"]=> + string(5) "Apple" + } +} +]]> + + + + + + Filtering results from <methodname>ReflectionClass::getMethods</methodname> + +getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_FINAL); +var_dump($methods); +?> +]]> + + &example.outputs; + + + &object(ReflectionMethod)#2 (2) { + ["name"]=> + string(12) "secondMethod" + ["class"]=> + string(5) "Apple" + } + [1]=> + &object(ReflectionMethod)#3 (2) { + ["name"]=> + string(11) "thirdMethod" + ["class"]=> + string(5) "Apple" + } +} +]]> + + diff --git a/reference/reflection/reflectionclass/getproperty.xml b/reference/reflection/reflectionclass/getproperty.xml index 13387e2d70..206592158f 100644 --- a/reference/reflection/reflectionclass/getproperty.xml +++ b/reference/reflection/reflectionclass/getproperty.xml @@ -4,7 +4,7 @@ ReflectionClass::getProperty - Gets property + Gets a ReflectionProperty for a class's property @@ -14,11 +14,9 @@ stringname - Gets a property. + Gets a ReflectionProperty for a class's property. - &warn.undocumented.func; - @@ -43,6 +41,35 @@ A ReflectionProperty. + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getProperty</methodname> + +getProperty('name'); +var_dump($property); +?> +]]> + + &example.outputs; + + + string(4) "name" + ["class"]=> + string(15) "ReflectionClass" +} +]]> + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionclass/getstaticpropertyvalue.xml b/reference/reflection/reflectionclass/getstaticpropertyvalue.xml index c5cf9c5984..dd859d514b 100644 --- a/reference/reflection/reflectionclass/getstaticpropertyvalue.xml +++ b/reference/reflection/reflectionclass/getstaticpropertyvalue.xml @@ -12,14 +12,11 @@ public mixedReflectionClass::getStaticPropertyValue stringname - stringdefault - Gets the static property values. + Gets the value of a static property on this class. - &warn.undocumented.func; - @@ -30,15 +27,7 @@ name - - - - - - default - - - + The name of the static property for which to return a value. @@ -49,7 +38,34 @@ &reftitle.returnvalues; - + The value of the static property. + + + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::getStaticPropertyValue</methodname> + +getStaticPropertyValue('color')); +?> +]]> + + &example.outputs; + + + + diff --git a/reference/reflection/reflectionclass/iscloneable.xml b/reference/reflection/reflectionclass/iscloneable.xml index 43299d94bc..d3df8aa2e4 100644 --- a/reference/reflection/reflectionclass/iscloneable.xml +++ b/reference/reflection/reflectionclass/iscloneable.xml @@ -14,11 +14,9 @@ - + Returns whether this class is cloneable. - &warn.undocumented.func; - @@ -32,7 +30,44 @@ Returns &true; if the class is cloneable, &false; otherwise. + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::isCloneable</methodname> + +isCloneable()); +var_dump($cloneable->isCloneable()); +?> +]]> + + &example.outputs; + + + + + + diff --git a/reference/reflection/reflectionclass/isinstantiable.xml b/reference/reflection/reflectionclass/isinstantiable.xml index 95359a23cc..0e769c6e79 100644 --- a/reference/reflection/reflectionclass/isinstantiable.xml +++ b/reference/reflection/reflectionclass/isinstantiable.xml @@ -4,7 +4,7 @@ ReflectionClass::isInstantiable - Checks if instantiable + Checks if the class is instantiable @@ -14,11 +14,9 @@ - Checks if the class is instanciable. + Checks if the class is instantiable. - &warn.undocumented.func; - diff --git a/reference/reflection/reflectionclass/isinterface.xml b/reference/reflection/reflectionclass/isinterface.xml index 03cab5c3b2..de793ea1c4 100644 --- a/reference/reflection/reflectionclass/isinterface.xml +++ b/reference/reflection/reflectionclass/isinterface.xml @@ -4,7 +4,7 @@ ReflectionClass::isInterface - Checks if interface + Checks if the class is an interface @@ -16,9 +16,6 @@ Checks whether the class is an interface. - - &warn.undocumented.func; - @@ -32,6 +29,33 @@ &return.success; + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::isInterface</methodname> + +isInterface()); +?> +]]> + + &example.outputs; + + + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionclass/isinternal.xml b/reference/reflection/reflectionclass/isinternal.xml index 305f55cb30..129eaadb93 100644 --- a/reference/reflection/reflectionclass/isinternal.xml +++ b/reference/reflection/reflectionclass/isinternal.xml @@ -4,7 +4,7 @@ ReflectionClass::isInternal - Checks if internal + Checks if class is defined internally by an extension, or the core @@ -14,11 +14,9 @@ - Checks whether the class is internal, as opposed to user-defined. + Checks if the class is defined internally by an extension, or the core, as opposed to user-defined. - &warn.undocumented.func; - @@ -32,6 +30,35 @@ &return.success; + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::isInternal</methodname> + +isInternal()); +var_dump($userclass->isInternal()); +?> +]]> + + &example.outputs; + + + + + + &reftitle.seealso; diff --git a/reference/reflection/reflectionclass/newinstanceargs.xml b/reference/reflection/reflectionclass/newinstanceargs.xml index c38bfae10c..605a57bc6e 100644 --- a/reference/reflection/reflectionclass/newinstanceargs.xml +++ b/reference/reflection/reflectionclass/newinstanceargs.xml @@ -18,8 +18,6 @@ class constructor. - &warn.undocumented.func; - @@ -44,6 +42,33 @@ Returns a new instance of the class. + + + &reftitle.examples; + + + Basic usage of <methodname>ReflectionClass::newInstanceArgs</methodname> + +newInstanceArgs(array('substr')); +var_dump($instance); +?> +]]> + + &example.outputs; + + + string(6) "substr" +} +]]> + + + + &reftitle.errors;