1 | <?php |
||
37 | abstract class AbstractResult implements ResultInterface, ActionAware, DescriptorAware |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The descriptor instance. |
||
42 | * |
||
43 | * @var \AppserverIo\Routlt\Description\ResultDescriptorInterface |
||
44 | */ |
||
45 | protected $descriptor; |
||
46 | |||
47 | /** |
||
48 | * The action result name. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $name; |
||
53 | |||
54 | /** |
||
55 | * The action result type. |
||
56 | * |
||
57 | * @var string |
||
58 | */ |
||
59 | protected $type; |
||
60 | |||
61 | /** |
||
62 | * The action result value. |
||
63 | * |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $result; |
||
67 | |||
68 | /** |
||
69 | * The HTTP response code that has to be send. |
||
70 | * |
||
71 | * @var string |
||
72 | */ |
||
73 | protected $code = 200; |
||
74 | |||
75 | /** |
||
76 | * Initializes the result from the result descriptor instance. |
||
77 | * |
||
78 | * @return void |
||
79 | */ |
||
80 | public function init() |
||
93 | |||
94 | /** |
||
95 | * Returns the action result name. |
||
96 | * |
||
97 | * @return string The action result name |
||
98 | */ |
||
99 | public function getName() |
||
103 | |||
104 | /** |
||
105 | * Returns the action result type. |
||
106 | * |
||
107 | * @return string The action result type |
||
108 | */ |
||
109 | public function getType() |
||
113 | |||
114 | /** |
||
115 | * Returns the action result value. |
||
116 | * |
||
117 | * @return string The action result value |
||
118 | */ |
||
119 | public function getResult() |
||
123 | |||
124 | /** |
||
125 | * Returns the HTTP response code that has to be send. |
||
126 | * |
||
127 | * @return integer The HTTP response code |
||
128 | */ |
||
129 | public function getCode() |
||
133 | |||
134 | /** |
||
135 | * Sets the actual action instance. |
||
136 | * |
||
137 | * @param \AppserverIo\Routlt\ActionInterface $action The action instance |
||
138 | * |
||
139 | * @return void |
||
140 | */ |
||
141 | public function setAction(ActionInterface $action) |
||
145 | |||
146 | /** |
||
147 | * Returns the action instance. |
||
148 | * |
||
149 | * @return \AppserverIo\Routlt\ActionInterface The action instance |
||
150 | */ |
||
151 | public function getAction() |
||
155 | |||
156 | /** |
||
157 | * Sets the descriptor instance. |
||
158 | * |
||
159 | * @param \AppserverIo\Psr\Deployment\DescriptorInterface $descriptor The descriptor instance |
||
160 | * |
||
161 | * @return void |
||
162 | */ |
||
163 | public function setDescriptor(DescriptorInterface $descriptor) |
||
167 | |||
168 | /** |
||
169 | * Returns the descriptor instance. |
||
170 | * |
||
171 | * @return \AppserverIo\Psr\Deployment\DescriptorInterface The descriptor instance |
||
172 | */ |
||
173 | public function getDescriptor() |
||
177 | } |
||
178 |
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.