Chris@0
|
1 <?php
|
Chris@0
|
2 /*
|
Chris@0
|
3 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
Chris@0
|
4 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
Chris@0
|
5 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
Chris@0
|
6 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
Chris@0
|
7 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
Chris@0
|
8 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
Chris@0
|
9 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
Chris@0
|
10 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
Chris@0
|
11 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
Chris@0
|
12 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
Chris@0
|
13 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Chris@0
|
14 *
|
Chris@0
|
15 * This software consists of voluntary contributions made by many individuals
|
Chris@0
|
16 * and is licensed under the MIT license. For more information, see
|
Chris@0
|
17 * <http://www.doctrine-project.org>.
|
Chris@0
|
18 */
|
Chris@0
|
19
|
Chris@0
|
20 namespace Doctrine\Common\Reflection;
|
Chris@0
|
21
|
Chris@0
|
22 use ReflectionException;
|
Chris@0
|
23 use ReflectionProperty;
|
Chris@0
|
24
|
Chris@0
|
25 class StaticReflectionProperty extends ReflectionProperty
|
Chris@0
|
26 {
|
Chris@0
|
27 /**
|
Chris@0
|
28 * The PSR-0 parser object.
|
Chris@0
|
29 *
|
Chris@0
|
30 * @var StaticReflectionParser
|
Chris@0
|
31 */
|
Chris@0
|
32 protected $staticReflectionParser;
|
Chris@0
|
33
|
Chris@0
|
34 /**
|
Chris@0
|
35 * The name of the property.
|
Chris@0
|
36 *
|
Chris@0
|
37 * @var string|null
|
Chris@0
|
38 */
|
Chris@0
|
39 protected $propertyName;
|
Chris@0
|
40
|
Chris@0
|
41 /**
|
Chris@0
|
42 * @param StaticReflectionParser $staticReflectionParser
|
Chris@0
|
43 * @param string|null $propertyName
|
Chris@0
|
44 */
|
Chris@0
|
45 public function __construct(StaticReflectionParser $staticReflectionParser, $propertyName)
|
Chris@0
|
46 {
|
Chris@0
|
47 $this->staticReflectionParser = $staticReflectionParser;
|
Chris@0
|
48 $this->propertyName = $propertyName;
|
Chris@0
|
49 }
|
Chris@0
|
50
|
Chris@0
|
51 /**
|
Chris@0
|
52 * {@inheritDoc}
|
Chris@0
|
53 */
|
Chris@0
|
54 public function getName()
|
Chris@0
|
55 {
|
Chris@0
|
56 return $this->propertyName;
|
Chris@0
|
57 }
|
Chris@0
|
58
|
Chris@0
|
59 /**
|
Chris@0
|
60 * @return StaticReflectionParser
|
Chris@0
|
61 */
|
Chris@0
|
62 protected function getStaticReflectionParser()
|
Chris@0
|
63 {
|
Chris@0
|
64 return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', $this->propertyName);
|
Chris@0
|
65 }
|
Chris@0
|
66
|
Chris@0
|
67 /**
|
Chris@0
|
68 * {@inheritDoc}
|
Chris@0
|
69 */
|
Chris@0
|
70 public function getDeclaringClass()
|
Chris@0
|
71 {
|
Chris@0
|
72 return $this->getStaticReflectionParser()->getReflectionClass();
|
Chris@0
|
73 }
|
Chris@0
|
74
|
Chris@0
|
75 /**
|
Chris@0
|
76 * {@inheritDoc}
|
Chris@0
|
77 */
|
Chris@0
|
78 public function getDocComment()
|
Chris@0
|
79 {
|
Chris@0
|
80 return $this->getStaticReflectionParser()->getDocComment('property', $this->propertyName);
|
Chris@0
|
81 }
|
Chris@0
|
82
|
Chris@0
|
83 /**
|
Chris@0
|
84 * @return array
|
Chris@0
|
85 */
|
Chris@0
|
86 public function getUseStatements()
|
Chris@0
|
87 {
|
Chris@0
|
88 return $this->getStaticReflectionParser()->getUseStatements();
|
Chris@0
|
89 }
|
Chris@0
|
90
|
Chris@0
|
91 /**
|
Chris@0
|
92 * {@inheritDoc}
|
Chris@0
|
93 */
|
Chris@0
|
94 public static function export($class, $name, $return = false)
|
Chris@0
|
95 {
|
Chris@0
|
96 throw new ReflectionException('Method not implemented');
|
Chris@0
|
97 }
|
Chris@0
|
98
|
Chris@0
|
99 /**
|
Chris@0
|
100 * {@inheritDoc}
|
Chris@0
|
101 */
|
Chris@0
|
102 public function getModifiers()
|
Chris@0
|
103 {
|
Chris@0
|
104 throw new ReflectionException('Method not implemented');
|
Chris@0
|
105 }
|
Chris@0
|
106
|
Chris@0
|
107 /**
|
Chris@0
|
108 * {@inheritDoc}
|
Chris@0
|
109 */
|
Chris@0
|
110 public function getValue($object = null)
|
Chris@0
|
111 {
|
Chris@0
|
112 throw new ReflectionException('Method not implemented');
|
Chris@0
|
113 }
|
Chris@0
|
114
|
Chris@0
|
115 /**
|
Chris@0
|
116 * {@inheritDoc}
|
Chris@0
|
117 */
|
Chris@0
|
118 public function isDefault()
|
Chris@0
|
119 {
|
Chris@0
|
120 throw new ReflectionException('Method not implemented');
|
Chris@0
|
121 }
|
Chris@0
|
122
|
Chris@0
|
123 /**
|
Chris@0
|
124 * {@inheritDoc}
|
Chris@0
|
125 */
|
Chris@0
|
126 public function isPrivate()
|
Chris@0
|
127 {
|
Chris@0
|
128 throw new ReflectionException('Method not implemented');
|
Chris@0
|
129 }
|
Chris@0
|
130
|
Chris@0
|
131 /**
|
Chris@0
|
132 * {@inheritDoc}
|
Chris@0
|
133 */
|
Chris@0
|
134 public function isProtected()
|
Chris@0
|
135 {
|
Chris@0
|
136 throw new ReflectionException('Method not implemented');
|
Chris@0
|
137 }
|
Chris@0
|
138
|
Chris@0
|
139 /**
|
Chris@0
|
140 * {@inheritDoc}
|
Chris@0
|
141 */
|
Chris@0
|
142 public function isPublic()
|
Chris@0
|
143 {
|
Chris@0
|
144 throw new ReflectionException('Method not implemented');
|
Chris@0
|
145 }
|
Chris@0
|
146
|
Chris@0
|
147 /**
|
Chris@0
|
148 * {@inheritDoc}
|
Chris@0
|
149 */
|
Chris@0
|
150 public function isStatic()
|
Chris@0
|
151 {
|
Chris@0
|
152 throw new ReflectionException('Method not implemented');
|
Chris@0
|
153 }
|
Chris@0
|
154
|
Chris@0
|
155 /**
|
Chris@0
|
156 * {@inheritDoc}
|
Chris@0
|
157 */
|
Chris@0
|
158 public function setAccessible($accessible)
|
Chris@0
|
159 {
|
Chris@0
|
160 throw new ReflectionException('Method not implemented');
|
Chris@0
|
161 }
|
Chris@0
|
162
|
Chris@0
|
163 /**
|
Chris@0
|
164 * {@inheritDoc}
|
Chris@0
|
165 */
|
Chris@0
|
166 public function setValue($object, $value = null)
|
Chris@0
|
167 {
|
Chris@0
|
168 throw new ReflectionException('Method not implemented');
|
Chris@0
|
169 }
|
Chris@0
|
170
|
Chris@0
|
171 /**
|
Chris@0
|
172 * {@inheritDoc}
|
Chris@0
|
173 */
|
Chris@0
|
174 public function __toString()
|
Chris@0
|
175 {
|
Chris@0
|
176 throw new ReflectionException('Method not implemented');
|
Chris@0
|
177 }
|
Chris@0
|
178 }
|