1 | <?php |
||
10 | class BfwController implements \SplObserver |
||
11 | { |
||
12 | /** |
||
13 | * @const ERR_RUN_OBJECT_CLASS_AND_METHOD_UNDEFINED Error code if the class |
||
14 | * and the method is not declared for the current route, in object mode. |
||
15 | */ |
||
16 | const ERR_RUN_OBJECT_CLASS_AND_METHOD_UNDEFINED = 2001001; |
||
17 | |||
18 | /** |
||
19 | * @const ERR_RUN_OBJECT_CLASS_NOT_FOUND Error code if the class declared |
||
20 | * for the route is not found. In object mode only. |
||
21 | */ |
||
22 | const ERR_RUN_OBJECT_CLASS_NOT_FOUND = 2001002; |
||
23 | |||
24 | /** |
||
25 | * @const ERR_RUN_OBJECT_METHOD_NOT_FOUND Error code if the method declared |
||
26 | * for the route is not found. In object mode only. |
||
27 | */ |
||
28 | const ERR_RUN_OBJECT_METHOD_NOT_FOUND = 2001003; |
||
29 | |||
30 | /** |
||
31 | * @const ERR_RUN_PROCEDURAL_FILE_NOT_FOUND Error code if the file to use |
||
32 | * for the route is not found. In procedural mode only. |
||
33 | */ |
||
34 | const ERR_RUN_PROCEDURAL_FILE_NOT_FOUND = 2001004; |
||
35 | |||
36 | /** |
||
37 | * @var \BFW\Module $module The bfw module instance for this module |
||
38 | */ |
||
39 | protected $module; |
||
40 | |||
41 | /** |
||
42 | * @var \BFW\Config $config The bfw config instance for this module |
||
43 | */ |
||
44 | protected $config; |
||
45 | |||
46 | /** |
||
47 | * @var \stdClass|null $ctrlRouterInfos The context object passed to |
||
48 | * subject for the action "searchRoute". |
||
49 | */ |
||
50 | protected $ctrlRouterInfos; |
||
51 | |||
52 | /** |
||
53 | * @var string $execRouteSystemName The name of the current system. Used on |
||
54 | * event "execRoute". Allow to extends this class in another module :) |
||
55 | */ |
||
56 | protected $execRouteSystemName = 'bfw-controller'; |
||
57 | |||
58 | /** |
||
59 | * Constructor |
||
60 | * Get config and linker instance |
||
61 | * |
||
62 | * @param \BFW\Module $module |
||
63 | */ |
||
64 | public function __construct(\BFW\Module $module) |
||
69 | |||
70 | /** |
||
71 | * Getter accessor for module property |
||
72 | * |
||
73 | * @return \BFW\Module |
||
74 | */ |
||
75 | public function getModule() |
||
79 | |||
80 | /** |
||
81 | * Getter accessor for config property |
||
82 | * |
||
83 | * @return \BFW\Config |
||
84 | */ |
||
85 | public function getConfig() |
||
89 | |||
90 | /** |
||
91 | * Getter accessor for ctrlRouterInfos property |
||
92 | * |
||
93 | * @return \stdClass |
||
94 | */ |
||
95 | public function getCtrlRouterInfos() |
||
99 | |||
100 | /** |
||
101 | * Getter accessor for execRouteSystemName property |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getExecRouteSystemName() |
||
109 | |||
110 | /** |
||
111 | * Observer update method |
||
112 | * |
||
113 | * @param \SplSubject $subject |
||
114 | * |
||
115 | * @return void |
||
116 | */ |
||
117 | public function update(\SplSubject $subject) |
||
136 | |||
137 | /** |
||
138 | * Set the property ctrlRouterInfos with the context object obtain linked |
||
139 | * to the subject. |
||
140 | * Allow override to get only some part. And used for unit test. |
||
141 | * |
||
142 | * @param \BFW\Subject $subject |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | protected function obtainCtrlRouterInfos($subject) |
||
150 | |||
151 | /** |
||
152 | * Run controller system if application is not run in cli mode |
||
153 | * |
||
154 | * @return void |
||
155 | */ |
||
156 | protected function run() |
||
174 | |||
175 | /** |
||
176 | * Call controller when is an object. |
||
177 | * |
||
178 | * @return void |
||
179 | */ |
||
180 | protected function runObject() |
||
215 | |||
216 | /** |
||
217 | * Call controler when is a procedural file |
||
218 | * |
||
219 | * @return void |
||
220 | */ |
||
221 | protected function runProcedural() |
||
240 | } |
||
241 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: