1 | <?php |
||
25 | class View |
||
26 | { |
||
27 | /** |
||
28 | * @var \Illuminate\Contracts\Config\Repository |
||
29 | */ |
||
30 | private $config; |
||
31 | |||
32 | /** |
||
33 | * @var \Aimeos\Shop\Base\I18n |
||
34 | */ |
||
35 | private $i18n; |
||
36 | |||
37 | /** |
||
38 | * @var \Aimeos\Shop\Base\Support |
||
39 | */ |
||
40 | private $support; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Initializes the object |
||
45 | * |
||
46 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
||
47 | * @param \Aimeos\Shop\Base\I18n $i18n I18n object |
||
48 | * @param \Aimeos\Shop\Base\Support $support Support object |
||
49 | */ |
||
50 | public function __construct( \Illuminate\Contracts\Config\Repository $config, |
||
57 | |||
58 | |||
59 | /** |
||
60 | * Creates the view object for the HTML client. |
||
61 | * |
||
62 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
||
63 | * @param array $templatePaths List of base path names with relative template paths as key/value pairs |
||
64 | * @param string|null $locale Code of the current language or null for no translation |
||
65 | * @return \Aimeos\MW\View\Iface View object |
||
66 | */ |
||
67 | public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null ) |
||
88 | |||
89 | |||
90 | /** |
||
91 | * Adds the "access" helper to the view object |
||
92 | * |
||
93 | * @param \Aimeos\MW\View\Iface $view View object |
||
94 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
||
95 | * @return \Aimeos\MW\View\Iface Modified view object |
||
96 | */ |
||
97 | protected function addAccess( \Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context ) |
||
119 | |||
120 | |||
121 | /** |
||
122 | * Adds the "config" helper to the view object |
||
123 | * |
||
124 | * @param \Aimeos\MW\View\Iface $view View object |
||
125 | * @param \Aimeos\MW\Config\Iface $config Configuration object |
||
126 | * @return \Aimeos\MW\View\Iface Modified view object |
||
127 | */ |
||
128 | protected function addConfig( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config ) |
||
136 | |||
137 | |||
138 | /** |
||
139 | * Adds the "access" helper to the view object |
||
140 | * |
||
141 | * @param \Aimeos\MW\View\Iface $view View object |
||
142 | * @return \Aimeos\MW\View\Iface Modified view object |
||
143 | */ |
||
144 | protected function addCsrf( \Aimeos\MW\View\Iface $view ) |
||
151 | |||
152 | |||
153 | /** |
||
154 | * Adds the "number" helper to the view object |
||
155 | * |
||
156 | * @param \Aimeos\MW\View\Iface $view View object |
||
157 | * @param \Aimeos\MW\Config\Iface $config Configuration object |
||
158 | * @return \Aimeos\MW\View\Iface Modified view object |
||
159 | */ |
||
160 | protected function addNumber( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config ) |
||
171 | |||
172 | |||
173 | /** |
||
174 | * Adds the "param" helper to the view object |
||
175 | * |
||
176 | * @param \Aimeos\MW\View\Iface $view View object |
||
177 | * @return \Aimeos\MW\View\Iface Modified view object |
||
178 | */ |
||
179 | protected function addParam( \Aimeos\MW\View\Iface $view ) |
||
187 | |||
188 | |||
189 | /** |
||
190 | * Adds the "request" helper to the view object |
||
191 | * |
||
192 | * @param \Aimeos\MW\View\Iface $view View object |
||
193 | * @return \Aimeos\MW\View\Iface Modified view object |
||
194 | */ |
||
195 | protected function addRequest( \Aimeos\MW\View\Iface $view ) |
||
202 | |||
203 | |||
204 | /** |
||
205 | * Adds the "response" helper to the view object |
||
206 | * |
||
207 | * @param \Aimeos\MW\View\Iface $view View object |
||
208 | * @return \Aimeos\MW\View\Iface Modified view object |
||
209 | */ |
||
210 | protected function addResponse( \Aimeos\MW\View\Iface $view ) |
||
217 | |||
218 | |||
219 | /** |
||
220 | * Adds the "session" helper to the view object |
||
221 | * |
||
222 | * @param \Aimeos\MW\View\Iface $view View object |
||
223 | * @param \Aimeos\MW\Session\Iface $session Session object |
||
224 | * @return \Aimeos\MW\View\Iface Modified view object |
||
225 | */ |
||
226 | protected function addSession( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Session\Iface $session ) |
||
233 | |||
234 | |||
235 | /** |
||
236 | * Adds the "translate" helper to the view object |
||
237 | * |
||
238 | * @param \Aimeos\MW\View\Iface $view View object |
||
239 | * @param string|null $locale ISO language code, e.g. "de" or "de_CH" |
||
240 | * @return \Aimeos\MW\View\Iface Modified view object |
||
241 | */ |
||
242 | protected function addTranslate( \Aimeos\MW\View\Iface $view, $locale ) |
||
259 | |||
260 | |||
261 | /** |
||
262 | * Adds the "url" helper to the view object |
||
263 | * |
||
264 | * @param \Aimeos\MW\View\Iface $view View object |
||
265 | * @return \Aimeos\MW\View\Iface Modified view object |
||
266 | */ |
||
267 | protected function addUrl( \Aimeos\MW\View\Iface $view ) |
||
291 | } |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: