1 | <?php |
||
38 | class ResultConfigurationDescriptor extends AbstractNameAwareDescriptor implements ResultConfigurationDescriptorInterface |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * The action result type. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $type; |
||
47 | |||
48 | /** |
||
49 | * The action result value. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $result; |
||
54 | |||
55 | /** |
||
56 | * The HTTP response code that has to be send. |
||
57 | * |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $code = 200; |
||
61 | |||
62 | /** |
||
63 | * Sets the action result type. |
||
64 | * |
||
65 | * @param string $type The action result type |
||
66 | * |
||
67 | * @return void |
||
68 | */ |
||
69 | public function setType($type) |
||
73 | |||
74 | /** |
||
75 | * Returns the action result type. |
||
76 | * |
||
77 | * @return string The action result type |
||
78 | */ |
||
79 | public function getType() |
||
83 | |||
84 | /** |
||
85 | * Sets the action result value. |
||
86 | * |
||
87 | * @param string $result The action result value |
||
88 | * |
||
89 | * @return void |
||
90 | */ |
||
91 | public function setResult($result) |
||
95 | |||
96 | /** |
||
97 | * Returns the action result value. |
||
98 | * |
||
99 | * @return string The action result value |
||
100 | */ |
||
101 | public function getResult() |
||
105 | |||
106 | /** |
||
107 | * Sets the HTTP response code that has to be send. |
||
108 | * |
||
109 | * @param integer $code The HTTP response code |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | public function setCode($code) |
||
117 | |||
118 | /** |
||
119 | * Returns the HTTP response code that has to be send. |
||
120 | * |
||
121 | * @return integer The HTTP response code |
||
122 | */ |
||
123 | public function getCode() |
||
127 | |||
128 | /** |
||
129 | * Returns a new descriptor instance. |
||
130 | * |
||
131 | * @return \AppserverIo\Routlt\Description\ResultDescriptorInterface The descriptor instance |
||
132 | */ |
||
133 | public static function newDescriptorInstance() |
||
137 | |||
138 | /** |
||
139 | * Returns a new annotation instance for the passed reflection class. |
||
140 | * |
||
141 | * @param \AppserverIo\Lang\Reflection\ClassInterface $reflectionClass The reflection class with the bean configuration |
||
142 | * |
||
143 | * @return \AppserverIo\Lang\Reflection\AnnotationInterface The reflection annotation |
||
144 | */ |
||
145 | protected function newAnnotationInstance(ClassInterface $reflectionClass) |
||
149 | |||
150 | /** |
||
151 | * Initializes the bean configuration instance from the passed reflection class instance. |
||
152 | * |
||
153 | * @param \AppserverIo\Lang\Reflection\ClassInterface $reflectionClass The reflection class with the bean configuration |
||
154 | * |
||
155 | * @return \AppserverIo\Routlt\Description\PathDescriptorInterface The initialized descriptor |
||
156 | */ |
||
157 | public function fromReflectionClass(ClassInterface $reflectionClass) |
||
160 | |||
161 | /** |
||
162 | * Initializes the result configuration instance from the passed reflection annotation instance. |
||
163 | * |
||
164 | * @param \AppserverIo\Lang\Reflection\AnnotationInterface $reflectionAnnotation The reflection annotation with the result configuration |
||
165 | * |
||
166 | * @return \AppserverIo\Routlt\Description\ResultDescriptorInterface The initialized descriptor |
||
167 | */ |
||
168 | public function fromReflectionAnnotation(AnnotationInterface $reflectionAnnotation) |
||
190 | |||
191 | /** |
||
192 | * Initializes a action configuration instance from the passed deployment descriptor node. |
||
193 | * |
||
194 | * @param \SimpleXmlElement $node The deployment node with the action configuration |
||
195 | * |
||
196 | * @return \AppserverIo\Routlt\Description\ActionDescriptorInterface The initialized descriptor |
||
197 | */ |
||
198 | public function fromDeploymentDescriptor(\SimpleXmlElement $node) |
||
201 | |||
202 | /** |
||
203 | * Initializes a action configuration instance from the passed configuration node. |
||
204 | * |
||
205 | * @param \AppserverIo\Configuration\Interfaces\NodeInterface $node The configuration node with the action configuration |
||
206 | * |
||
207 | * @return \AppserverIo\Routlt\Description\ActionDescriptorInterface The initialized descriptor |
||
208 | */ |
||
209 | public function fromConfiguration(NodeInterface $node) |
||
212 | |||
213 | /** |
||
214 | * Merges the passed configuration into this one. Configuration values |
||
215 | * of the passed configuration will overwrite the this one. |
||
216 | * |
||
217 | * @param \AppserverIo\Routlt\Description\ResultConfigurationDescriptorInterface $resultConfigurationDescriptor The configuration to merge |
||
218 | * |
||
219 | * @return void |
||
220 | * @throws \AppserverIo\Routlt\Description\DescriptorException Is thrown if the passed descriptor has a different method name |
||
221 | */ |
||
222 | public function merge(ResultConfigurationDescriptorInterface $resultConfigurationDescriptor) |
||
247 | } |
||
248 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.