1 | <?php |
||
12 | class Application |
||
13 | { |
||
14 | /** |
||
15 | * @var \stdClass |
||
16 | */ |
||
17 | private $config; |
||
18 | /** |
||
19 | * @var \library\storage\Storage $config |
||
20 | */ |
||
21 | private $storage; |
||
22 | |||
23 | /** |
||
24 | * @var Request |
||
25 | */ |
||
26 | private $request; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $matchedSitemapItems = array(); |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $applicationComponents = array(); |
||
37 | |||
38 | /** |
||
39 | * Application constructor. |
||
40 | */ |
||
41 | public function __construct() |
||
60 | |||
61 | /** |
||
62 | * Initialize the config |
||
63 | * |
||
64 | * @throws \Exception |
||
65 | */ |
||
66 | private function config() |
||
76 | |||
77 | /** |
||
78 | * Initialize the storage |
||
79 | */ |
||
80 | private function storage() |
||
86 | |||
87 | /** |
||
88 | * Loop through sitemap items and see if one matches the requestUri. |
||
89 | * If it does, add it tot the matchedSitemapItems array |
||
90 | * |
||
91 | * @param $request |
||
92 | */ |
||
93 | private function sitemapMatching($request) |
||
116 | |||
117 | /** |
||
118 | * Loop through all application components and run them |
||
119 | * |
||
120 | * @throws \Exception |
||
121 | */ |
||
122 | private function runApplicationComponents() |
||
123 | { |
||
124 | foreach ($this->applicationComponents as $key => $applicationComponent) { |
||
125 | $class = $applicationComponent->component; |
||
126 | $parameters = $applicationComponent->parameters; |
||
127 | $this->applicationComponents[$key]->{'object'} = $this->getComponentObject($class, null, $parameters, null); |
||
|
|||
128 | $this->applicationComponents[$key]->{'object'}->run($this->storage); |
||
129 | } |
||
130 | } |
||
131 | |||
132 | /** |
||
133 | * Loop through all (matched) sitemap components and run them |
||
134 | * |
||
135 | * @throws \Exception |
||
136 | */ |
||
137 | private function runSitemapComponents() |
||
149 | |||
150 | /** |
||
151 | * @param string $class |
||
152 | * @param string $template |
||
153 | * @param array $parameters |
||
154 | * @param \stdClass $matchedSitemapItem |
||
155 | * |
||
156 | * @return mixed |
||
157 | * @throws \Exception |
||
158 | */ |
||
159 | private function getComponentObject($class='', $template='', $parameters=array(), $matchedSitemapItem) |
||
178 | |||
179 | /** |
||
180 | * Loop through all application components and render them |
||
181 | */ |
||
182 | private function renderApplicationComponents() |
||
188 | |||
189 | /** |
||
190 | * Loop through all (matched) sitemap components and render them |
||
191 | */ |
||
192 | private function renderSitemapComponents() |
||
203 | |||
204 | public function getAllApplicationComponentParameters() |
||
213 | |||
214 | public function unlockApplicationComponentParameters() |
||
221 | |||
222 | /** |
||
223 | * Set the default caching of pages to 2 days |
||
224 | */ |
||
225 | public function setCachingHeaders() |
||
230 | |||
231 | /** |
||
232 | * @return string |
||
233 | */ |
||
234 | public function getStorageType() |
||
238 | |||
239 | /** |
||
240 | * @return string |
||
241 | */ |
||
242 | public function getStoragePath() |
||
246 | |||
247 | public function getApplicationComponents() |
||
251 | |||
252 | } |
||
253 | } |
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: