argument registration
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Reflection / ParameterReflection.php
1 <?php
2
3 /* *
4 * This script belongs to the FLOW3 framework. *
5 * *
6 * It is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU Lesser General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or (at your *
9 * option) any later version. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
14 * General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with the script. *
18 * If not, see http://www.gnu.org/licenses/lgpl.html *
19 * *
20 * The TYPO3 project - inspiring people to share! *
21 * */
22
23 /**
24 * @package FLOW3
25 * @subpackage Reflection
26 * @version $Id: ParameterReflection.php 1811 2009-01-28 12:04:49Z robert $
27 */
28
29 /**
30 * Extended version of the ReflectionParameter
31 *
32 * @package FLOW3
33 * @subpackage Reflection
34 * @version $Id: ParameterReflection.php 1811 2009-01-28 12:04:49Z robert $
35 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
36 */
37 class Tx_ExtBase_Reflection_ParameterReflection extends ReflectionParameter {
38
39 /**
40 * The constructor, initializes the reflection parameter
41 *
42 * @param string $functionName: Name of the function
43 * @param string $propertyName: Name of the property to reflect
44 * @return void
45 * @author Robert Lemke <robert@typo3.org>
46 */
47 public function __construct($function, $parameterName) {
48 parent::__construct($function, $parameterName);
49 }
50
51 /**
52 * Returns the declaring class
53 *
54 * @return Tx_ExtBase_Reflection_ClassReflection The declaring class
55 * @author Robert Lemke <robert@typo3.org>
56 */
57 public function getDeclaringClass() {
58 return new Tx_ExtBase_Reflection_ClassReflection(parent::getDeclaringClass()->getName());
59 }
60
61 /**
62 * Returns the parameter class
63 *
64 * @return Tx_ExtBase_Reflection_ClassReflection The parameter class
65 * @author Robert Lemke <robert@typo3.org>
66 * @author Karsten Dambekalns <karsten@typo3.org>
67 */
68 public function getClass() {
69 try {
70 $class = parent::getClass();
71 } catch (Exception $e) {
72 return NULL;
73 }
74
75 return is_object($class) ? new Tx_ExtBase_Reflection_ClassReflection($class->getName()) : NULL;
76 }
77
78 }
79
80 ?>