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