From 314d5d831f51c844aa0ede08962d99e3c861d18e Mon Sep 17 00:00:00 2001 From: Joris van de Sande Date: Tue, 27 Jul 2010 18:46:35 +0000 Subject: [PATCH] - Documented arguments, returnvalues and erros for ReflectionClass methods: getFileName, newInstance, newInstanceArgs and __toString - Added example for ReflectionClass method __toString git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301619 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../reflectionclass/getfilename.xml | 10 +-- .../reflectionclass/newinstance.xml | 24 +++-- .../reflectionclass/newinstanceargs.xml | 20 ++++- .../reflection/reflectionclass/tostring.xml | 89 +++++++++++++++++-- 4 files changed, 122 insertions(+), 21 deletions(-) diff --git a/reference/reflection/reflectionclass/getfilename.xml b/reference/reflection/reflectionclass/getfilename.xml index af716f3657..1023d2b009 100644 --- a/reference/reflection/reflectionclass/getfilename.xml +++ b/reference/reflection/reflectionclass/getfilename.xml @@ -4,7 +4,7 @@ ReflectionClass::getFileName - Gets a filename + Gets the filename of the file in which the class has been defined @@ -14,11 +14,9 @@ - Gets a filename. + Gets the filename of the file in which the class has been defined. - &warn.undocumented.func; - @@ -29,7 +27,9 @@ &reftitle.returnvalues; - The filename. + Returns the filename of the file in which the class has been defined. + If the class is defined in the PHP core or in a PHP extension, &false; + is returned. diff --git a/reference/reflection/reflectionclass/newinstance.xml b/reference/reflection/reflectionclass/newinstance.xml index 877d40b846..ecbff807ab 100644 --- a/reference/reflection/reflectionclass/newinstance.xml +++ b/reference/reflection/reflectionclass/newinstance.xml @@ -4,7 +4,7 @@ ReflectionClass::newInstance - New instance + Creates a new cass instance from given arguments. @@ -15,11 +15,10 @@ mixed... - A new instance. + Creates a new cass instance of the class, the given arguments are passed + to the class constructor. - &warn.undocumented.func; - @@ -30,8 +29,8 @@ args - Accepts a variable number of arguments which are passed to the function - much like call_user_func. + Accepts a variable number of arguments which are passed to the class + constructor, much like call_user_func. @@ -42,7 +41,18 @@ &reftitle.returnvalues; - + + + + + + &reftitle.errors; + + A ReflectionException if the class constructor is not public. + + + A ReflectionException if the class does not have a constructor + and the args parameter contains one or more parameters. diff --git a/reference/reflection/reflectionclass/newinstanceargs.xml b/reference/reflection/reflectionclass/newinstanceargs.xml index e2c13bf1f0..ba58d226e0 100644 --- a/reference/reflection/reflectionclass/newinstanceargs.xml +++ b/reference/reflection/reflectionclass/newinstanceargs.xml @@ -4,7 +4,7 @@ ReflectionClass::newInstanceArgs - New instance args + Creates a new cass instance from given arguments. @@ -14,7 +14,8 @@ arrayargs - New instance args. + Creates a new cass instance of the class, the given arguments are passed + to the class constructor. &warn.undocumented.func; @@ -29,7 +30,7 @@ args - + The parameters to be passed to the class constructor as an array. @@ -40,7 +41,18 @@ &reftitle.returnvalues; - + Returns a new instance of the class. + + + + + &reftitle.errors; + + A ReflectionException if the class constructor is not public. + + + A ReflectionException if the class does not have a constructor + and the args parameter contains one or more parameters. diff --git a/reference/reflection/reflectionclass/tostring.xml b/reference/reflection/reflectionclass/tostring.xml index c61baf21a8..7694c00b82 100644 --- a/reference/reflection/reflectionclass/tostring.xml +++ b/reference/reflection/reflectionclass/tostring.xml @@ -4,7 +4,7 @@ ReflectionClass::__toString - To string + Returns the string representation of the ReflectionClass object. @@ -14,11 +14,9 @@ - To a string. + Returns the string representation of the ReflectionClass object. - &warn.undocumented.func; - @@ -29,7 +27,88 @@ &reftitle.returnvalues; - + A string representation of this ReflectionClass instance. + + + + + &reftitle.examples; + + + <methodname>ReflectionClass::__toString</methodname> example + +__toString(); +?> +]]> + + &example.outputs; + + class Exception ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [7] { + Property [ protected $message ] + Property [ private $string ] + Property [ protected $code ] + Property [ protected $file ] + Property [ protected $line ] + Property [ private $trace ] + Property [ private $previous ] + } + + - Methods [10] { + Method [ final private method __clone ] { + } + + Method [ public method __construct ] { + + - Parameters [3] { + Parameter #0 [ $message ] + Parameter #1 [ $code ] + Parameter #2 [ $previous ] + } + } + + Method [ final public method getMessage ] { + } + + Method [ final public method getCode ] { + } + + Method [ final public method getFile ] { + } + + Method [ final public method getLine ] { + } + + Method [ final public method getTrace ] { + } + + Method [ final public method getPrevious ] { + } + + Method [ final public method getTraceAsString ] { + } + + Method [ public method __toString ] { + } + } +} +]]> + +