-
Notifications
You must be signed in to change notification settings - Fork 1
/
annotationparameter.php
executable file
·66 lines (58 loc) · 1.81 KB
/
annotationparameter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
namespace MattRWallace\Exegesis;
/**
* AnnotationParameter
*
* @package Exegesis
* @version 0.7 (Beta 2)
* @copyright Copyright (c) 2012 Matt Wallace All rights reserved.
* @author Matt Wallace <matthew.wallace@ieee.org>
* @license http://www.opensource.org/licenses/mit-license.html MIT Public License.
*/
class AnnotationParameter extends \ReflectionParameter {
use Annotation;
/**
* Constructor
*
* @param string $function Name of the function to reflect parameters from
* @param string $parameter The name of the parameter
* @access public
* @return void
*/
public function __construct($function, $parameter) {
parent::__construct($function, $parameter);
$parser = new AnnotationParser($this->getDocComment());
$this->annotations = $parser->getAnnotationArray();
}
/**
* Wrapper function around ReflectionParameter::getClass to return an
* AnnotationClass object instead of a ReflectionClass object.
*
* @access public
* @return void
*/
public function getClass() {
return new AnnotationClass(parent::getClass());
}
/**
* Wrapper function around ReflectionParameter::getDeclaringClass to return an
* AnnotationClass object instead of a ReflectionClass object.
*
* @access public
* @return void
*/
public function getDeclaringClass() {
return new AnnotationClass(parent::getDeclaringClass());
}
/**
* Wrapper function around ReflectionParameter::getDeclaringFunction to
* return an AnnotationMethod object instead of a ReflectionMethod
* object.
*
* @access public
* @return void
*/
public function getDeclaringFunction() {
return new AnnotationFunction(parent::getDeclaringFunction()->getName());
}
}