1 | <?php |
||
35 | class ResultDescriptor implements ResultDescriptorInterface |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * The arction result name. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $name; |
||
44 | |||
45 | /** |
||
46 | * The action result type. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $type; |
||
51 | |||
52 | /** |
||
53 | * The action result value. |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $result; |
||
58 | |||
59 | /** |
||
60 | * The HTTP response code that has to be send. |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $code = 200; |
||
65 | |||
66 | /** |
||
67 | * Sets the action result name. |
||
68 | * |
||
69 | * @param string $name The action result name |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | public function setName($name) |
||
77 | |||
78 | /** |
||
79 | * Returns the action result name. |
||
80 | * |
||
81 | * @return string The action result name |
||
82 | */ |
||
83 | public function getName() |
||
87 | |||
88 | /** |
||
89 | * Sets the action result type. |
||
90 | * |
||
91 | * @param string $type The action result type |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function setType($type) |
||
99 | |||
100 | /** |
||
101 | * Returns the action result type. |
||
102 | * |
||
103 | * @return string The action result type |
||
104 | */ |
||
105 | public function getType() |
||
109 | |||
110 | /** |
||
111 | * Sets the action result value. |
||
112 | * |
||
113 | * @param string $result The action result value |
||
114 | * |
||
115 | * @return void |
||
116 | */ |
||
117 | public function setResult($result) |
||
121 | |||
122 | /** |
||
123 | * Returns the action result value. |
||
124 | * |
||
125 | * @return string The action result value |
||
126 | */ |
||
127 | public function getResult() |
||
131 | |||
132 | /** |
||
133 | * Sets the HTTP response code that has to be send. |
||
134 | * |
||
135 | * @param integer $code The HTTP response code |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function setCode($code) |
||
143 | |||
144 | /** |
||
145 | * Returns the HTTP response code that has to be send. |
||
146 | * |
||
147 | * @return integer The HTTP response code |
||
148 | */ |
||
149 | public function getCode() |
||
153 | |||
154 | /** |
||
155 | * Returns a new descriptor instance. |
||
156 | * |
||
157 | * @return \AppserverIo\Routlt\Description\ResultDescriptorInterface The descriptor instance |
||
158 | */ |
||
159 | public static function newDescriptorInstance() |
||
163 | |||
164 | /** |
||
165 | * Initializes the result configuration instance from the passed reflection annotation instance. |
||
166 | * |
||
167 | * @param \AppserverIo\Lang\Reflection\AnnotationInterface $reflectionAnnotation The reflection annotation with the result configuration |
||
168 | * |
||
169 | * @return \AppserverIo\Routlt\Description\ResultDescriptorInterface The initialized descriptor |
||
170 | */ |
||
171 | public function fromReflectionAnnotation(AnnotationInterface $reflectionAnnotation) |
||
193 | |||
194 | /** |
||
195 | * Initializes a action configuration instance from the passed deployment descriptor node. |
||
196 | * |
||
197 | * @param \SimpleXmlElement $node The deployment node with the action configuration |
||
198 | * |
||
199 | * @return \AppserverIo\Routlt\Description\ActionDescriptorInterface The initialized descriptor |
||
200 | */ |
||
201 | public function fromDeploymentDescriptor(\SimpleXmlElement $node) |
||
204 | |||
205 | /** |
||
206 | * Initializes a action configuration instance from the passed configuration node. |
||
207 | * |
||
208 | * @param \AppserverIo\Configuration\Interfaces\NodeInterface $node The configuration node with the action configuration |
||
209 | * |
||
210 | * @return \AppserverIo\Routlt\Description\ActionDescriptorInterface The initialized descriptor |
||
211 | */ |
||
212 | public function fromConfiguration(NodeInterface $node) |
||
215 | |||
216 | /** |
||
217 | * Merges the passed configuration into this one. Configuration values |
||
218 | * of the passed configuration will overwrite the this one. |
||
219 | * |
||
220 | * @param \AppserverIo\Routlt\Description\ResultDescriptorInterface $resultDescriptor The configuration to merge |
||
221 | * |
||
222 | * @return void |
||
223 | * @throws \AppserverIo\Routlt\Description\DescriptorException Is thrown if the passed descriptor has a different method name |
||
224 | */ |
||
225 | public function merge(ResultDescriptorInterface $resultDescriptor) |
||
250 | } |
||
251 |
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.