1 | <?php |
||
36 | abstract class AbstractMiddleware implements MiddlewareInterface, DataPreProcessorInterface |
||
37 | { |
||
38 | use StateMiddlewareDependencyTrait; |
||
39 | |||
40 | /** |
||
41 | * @var \Romm\Formz\Middleware\Option\DefaultOptionDefinition |
||
42 | */ |
||
43 | protected $options; |
||
44 | |||
45 | /** |
||
46 | * @param AbstractOptionDefinition $options |
||
47 | */ |
||
48 | final public function __construct(AbstractOptionDefinition $options) |
||
52 | |||
53 | /** |
||
54 | * Abstraction for processing the middleware initialization. |
||
55 | * |
||
56 | * For own initialization, @see initializeMiddleware() |
||
57 | */ |
||
58 | final public function initialize() |
||
62 | |||
63 | /** |
||
64 | * You can override this method in your child class to initialize your |
||
65 | * middleware correctly. |
||
66 | */ |
||
67 | protected function initializeMiddleware() |
||
70 | |||
71 | /** |
||
72 | * Returns a new forward dispatcher, on which you can add options by calling |
||
73 | * its fluent methods. |
||
74 | * |
||
75 | * You must call the method `dispatch()` to actually dispatch the forward |
||
76 | * signal. |
||
77 | * |
||
78 | * @return Forward |
||
79 | */ |
||
80 | final protected function forward() |
||
84 | |||
85 | /** |
||
86 | * Returns a new redirect dispatcher, on which you can add options by |
||
87 | * calling its fluent methods. |
||
88 | * |
||
89 | * You must call the method `dispatch()` to actually dispatch the redirect |
||
90 | * signal. |
||
91 | * |
||
92 | * @return Redirect |
||
93 | */ |
||
94 | final protected function redirect() { |
||
97 | |||
98 | /** |
||
99 | * Will stop the propagation of middlewares: the next middlewares wont be |
||
100 | * processed. |
||
101 | * |
||
102 | * Use with caution! |
||
103 | */ |
||
104 | final protected function stopPropagation() |
||
108 | |||
109 | /** |
||
110 | * @return FormObject |
||
111 | */ |
||
112 | final protected function getFormObject() |
||
116 | |||
117 | /** |
||
118 | * @return FormResult |
||
119 | */ |
||
120 | final protected function getResult() |
||
124 | |||
125 | /** |
||
126 | * @return Request |
||
127 | */ |
||
128 | final protected function getRequest() |
||
132 | |||
133 | /** |
||
134 | * @return Arguments |
||
135 | */ |
||
136 | final protected function getRequestArguments() |
||
140 | |||
141 | /** |
||
142 | * @return array |
||
143 | */ |
||
144 | final protected function getSettings() |
||
148 | |||
149 | /** |
||
150 | * @return int |
||
151 | */ |
||
152 | public function getPriority() |
||
156 | |||
157 | /** |
||
158 | * Returns the name of the signal on which this middleware is bound. |
||
159 | * |
||
160 | * @return string |
||
161 | * @throws EntryNotFoundException |
||
162 | */ |
||
163 | final public function getBoundSignalName() |
||
175 | |||
176 | /** |
||
177 | * Will inject empty options if no option has been defined at all. |
||
178 | * |
||
179 | * @param DataPreProcessor $processor |
||
180 | */ |
||
181 | public static function dataPreProcessor(DataPreProcessor $processor) |
||
191 | } |
||
192 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.