@@ -19,7 +19,6 @@ |
||
19 | 19 | use Nette\Application; |
20 | 20 | use Nette\Application\Responses; |
21 | 21 | use Nette\Http; |
22 | - |
|
23 | 22 | use IPub\MobileDetect; |
24 | 23 | use IPub\MobileDetect\Helpers; |
25 | 24 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 22.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Events; |
18 | 18 | |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | $url->setQueryParameter($this->deviceView->getSwitchParameterName(), null); |
380 | 380 | |
381 | 381 | // Create full path url |
382 | - $redirectUrl = $this->getCurrentHost() . $url->getRelativeUrl(); |
|
382 | + $redirectUrl = $this->getCurrentHost().$url->getRelativeUrl(); |
|
383 | 383 | |
384 | 384 | // Generate only domain path |
385 | 385 | } else { |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | if ($routingOption = $this->getRoutingOption($platform)) { |
421 | 421 | switch ($routingOption) { |
422 | 422 | case self::REDIRECT: |
423 | - return rtrim($this->redirectConf[$platform]['host'], '/') . '/' . ltrim($this->httpRequest->getUrl()->getRelativeUrl(), '/'); |
|
423 | + return rtrim($this->redirectConf[$platform]['host'], '/').'/'.ltrim($this->httpRequest->getUrl()->getRelativeUrl(), '/'); |
|
424 | 424 | |
425 | 425 | case self::REDIRECT_WITHOUT_PATH: |
426 | 426 | return $this->redirectConf[$platform]['host']; |
@@ -467,6 +467,6 @@ discard block |
||
467 | 467 | */ |
468 | 468 | private function getCurrentHost() : string |
469 | 469 | { |
470 | - return $this->httpRequest->getUrl()->getHostUrl() . $this->httpRequest->getUrl()->getScriptPath(); |
|
470 | + return $this->httpRequest->getUrl()->getHostUrl().$this->httpRequest->getUrl()->getScriptPath(); |
|
471 | 471 | } |
472 | 472 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * @var bool |
51 | 51 | */ |
52 | - public $isFullPath = true; |
|
52 | + public $isFullPath = TRUE; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * @var Http\IRequest |
@@ -207,27 +207,27 @@ discard block |
||
207 | 207 | private function hasPhoneRedirect() : bool |
208 | 208 | { |
209 | 209 | if (!$this->redirectConf['phone']['isEnabled']) { |
210 | - return false; |
|
210 | + return FALSE; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $isPhone = $this->mobileDetect->isPhone(); |
214 | 214 | |
215 | - if ($this->redirectConf['detectPhoneAsMobile'] === false) { |
|
215 | + if ($this->redirectConf['detectPhoneAsMobile'] === FALSE) { |
|
216 | 216 | $isPhoneHost = ($this->getCurrentHost() === $this->redirectConf['phone']['host']); |
217 | 217 | |
218 | 218 | if ($isPhone && !$isPhoneHost && ($this->getRoutingOption(self::PHONE) != self::NO_REDIRECT)) { |
219 | - return true; |
|
219 | + return TRUE; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | } else { |
223 | 223 | $isMobileHost = ($this->getCurrentHost() === $this->redirectConf['mobile']['host']); |
224 | 224 | |
225 | 225 | if ($isPhone && !$isMobileHost && ($this->getRoutingOption(self::PHONE) != self::NO_REDIRECT)) { |
226 | - return true; |
|
226 | + return TRUE; |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | |
230 | - return false; |
|
230 | + return FALSE; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -238,27 +238,27 @@ discard block |
||
238 | 238 | private function hasTabletRedirect() : bool |
239 | 239 | { |
240 | 240 | if (!$this->redirectConf['tablet']['isEnabled']) { |
241 | - return false; |
|
241 | + return FALSE; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $isTablet = $this->mobileDetect->isTablet(); |
245 | 245 | |
246 | - if ($this->redirectConf['detectTabletAsMobile'] === false) { |
|
246 | + if ($this->redirectConf['detectTabletAsMobile'] === FALSE) { |
|
247 | 247 | $isTabletHost = ($this->getCurrentHost() === $this->redirectConf['tablet']['host']); |
248 | 248 | |
249 | 249 | if ($isTablet && !$isTabletHost && ($this->getRoutingOption(self::TABLET) != self::NO_REDIRECT)) { |
250 | - return true; |
|
250 | + return TRUE; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | } else { |
254 | 254 | $isMobileHost = ($this->getCurrentHost() === $this->redirectConf['mobile']['host']); |
255 | 255 | |
256 | 256 | if ($isTablet && !$isMobileHost && ($this->getRoutingOption(self::TABLET) != self::NO_REDIRECT)) { |
257 | - return true; |
|
257 | + return TRUE; |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | - return false; |
|
261 | + return FALSE; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | /** |
@@ -269,13 +269,13 @@ discard block |
||
269 | 269 | private function hasMobileRedirect() : bool |
270 | 270 | { |
271 | 271 | if (!$this->redirectConf['mobile']['isEnabled']) { |
272 | - return false; |
|
272 | + return FALSE; |
|
273 | 273 | } |
274 | 274 | |
275 | - if ($this->redirectConf['detectPhoneAsMobile'] === false) { |
|
275 | + if ($this->redirectConf['detectPhoneAsMobile'] === FALSE) { |
|
276 | 276 | $isMobile = ($this->mobileDetect->isTablet() || ($this->mobileDetect->isMobile()) && !$this->mobileDetect->isPhone()); |
277 | 277 | |
278 | - } elseif ($this->redirectConf['detectTabletAsMobile'] === false) { |
|
278 | + } elseif ($this->redirectConf['detectTabletAsMobile'] === FALSE) { |
|
279 | 279 | $isMobile = ($this->mobileDetect->isPhone() || ($this->mobileDetect->isMobile()) && !$this->mobileDetect->isTablet()); |
280 | 280 | |
281 | 281 | } else { |
@@ -285,10 +285,10 @@ discard block |
||
285 | 285 | $isMobileHost = ($this->getCurrentHost() === $this->redirectConf['mobile']['host']); |
286 | 286 | |
287 | 287 | if ($isMobile && !$isMobileHost && ($this->getRoutingOption(self::MOBILE) != self::NO_REDIRECT)) { |
288 | - return true; |
|
288 | + return TRUE; |
|
289 | 289 | } |
290 | 290 | |
291 | - return false; |
|
291 | + return FALSE; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -298,15 +298,15 @@ discard block |
||
298 | 298 | */ |
299 | 299 | private function needPhoneResponseModify() : bool |
300 | 300 | { |
301 | - if (($this->deviceView->getViewType() === null || $this->deviceView->isPhoneView()) && $this->mobileDetect->isMobile() && !$this->mobileDetect->isTablet()) { |
|
301 | + if (($this->deviceView->getViewType() === NULL || $this->deviceView->isPhoneView()) && $this->mobileDetect->isMobile() && !$this->mobileDetect->isTablet()) { |
|
302 | 302 | $this->onResponseHandler->modifyResponseClosure = function (Helpers\DeviceView $deviceView) : Http\IResponse { |
303 | 303 | return $deviceView->modifyPhoneResponse(); |
304 | 304 | }; |
305 | 305 | |
306 | - return true; |
|
306 | + return TRUE; |
|
307 | 307 | } |
308 | 308 | |
309 | - return false; |
|
309 | + return FALSE; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
@@ -316,15 +316,15 @@ discard block |
||
316 | 316 | */ |
317 | 317 | private function needTabletResponseModify() : bool |
318 | 318 | { |
319 | - if (($this->deviceView->getViewType() === null || $this->deviceView->isTabletView()) && $this->mobileDetect->isTablet()) { |
|
319 | + if (($this->deviceView->getViewType() === NULL || $this->deviceView->isTabletView()) && $this->mobileDetect->isTablet()) { |
|
320 | 320 | $this->onResponseHandler->modifyResponseClosure = function (Helpers\DeviceView $deviceView) : Http\IResponse { |
321 | 321 | return $deviceView->modifyTabletResponse(); |
322 | 322 | }; |
323 | 323 | |
324 | - return true; |
|
324 | + return TRUE; |
|
325 | 325 | } |
326 | 326 | |
327 | - return false; |
|
327 | + return FALSE; |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -334,15 +334,15 @@ discard block |
||
334 | 334 | */ |
335 | 335 | private function needMobileResponseModify() : bool |
336 | 336 | { |
337 | - if (($this->deviceView->getViewType() === null || $this->deviceView->isMobileView()) && $this->mobileDetect->isMobile()) { |
|
337 | + if (($this->deviceView->getViewType() === NULL || $this->deviceView->isMobileView()) && $this->mobileDetect->isMobile()) { |
|
338 | 338 | $this->onResponseHandler->modifyResponseClosure = function (Helpers\DeviceView $deviceView) : Http\IResponse { |
339 | 339 | return $deviceView->modifyMobileResponse(); |
340 | 340 | }; |
341 | 341 | |
342 | - return true; |
|
342 | + return TRUE; |
|
343 | 343 | } |
344 | 344 | |
345 | - return false; |
|
345 | + return FALSE; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -352,15 +352,15 @@ discard block |
||
352 | 352 | */ |
353 | 353 | private function needNotMobileResponseModify() : bool |
354 | 354 | { |
355 | - if ($this->deviceView->getViewType() === null || $this->deviceView->isNotMobileView()) { |
|
355 | + if ($this->deviceView->getViewType() === NULL || $this->deviceView->isNotMobileView()) { |
|
356 | 356 | $this->onResponseHandler->modifyResponseClosure = function (Helpers\DeviceView $deviceView) : Http\IResponse { |
357 | 357 | return $deviceView->modifyNotMobileResponse(); |
358 | 358 | }; |
359 | 359 | |
360 | - return true; |
|
360 | + return TRUE; |
|
361 | 361 | } |
362 | 362 | |
363 | - return false; |
|
363 | + return FALSE; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | /** |
@@ -371,12 +371,12 @@ discard block |
||
371 | 371 | private function getRedirectResponseBySwitchParam() : Responses\RedirectResponse |
372 | 372 | { |
373 | 373 | // Generate full url path |
374 | - if ($this->isFullPath === true) { |
|
374 | + if ($this->isFullPath === TRUE) { |
|
375 | 375 | // Get actual url |
376 | 376 | $url = $this->httpRequest->getUrl(); |
377 | 377 | |
378 | 378 | // Remove switch param |
379 | - $url->setQueryParameter($this->deviceView->getSwitchParameterName(), null); |
|
379 | + $url->setQueryParameter($this->deviceView->getSwitchParameterName(), NULL); |
|
380 | 380 | |
381 | 381 | // Create full path url |
382 | 382 | $redirectUrl = $this->getCurrentHost() . $url->getRelativeUrl(); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | ); |
406 | 406 | } |
407 | 407 | |
408 | - return null; |
|
408 | + return NULL; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | } |
428 | 428 | } |
429 | 429 | |
430 | - return null; |
|
430 | + return NULL; |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | /** |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | */ |
440 | 440 | private function getRoutingOption(string $name) : ?string |
441 | 441 | { |
442 | - $option = null; |
|
442 | + $option = NULL; |
|
443 | 443 | |
444 | 444 | // Get actual route |
445 | 445 | $request = $this->router->match($this->httpRequest); |
446 | 446 | |
447 | 447 | if ($request instanceof Application\Request) { |
448 | 448 | $params = $request->getParameters(); |
449 | - $option = isset($params[$name]) ? $params[$name] : null; |
|
449 | + $option = isset($params[$name]) ? $params[$name] : NULL; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | if (!$option) { |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | return $option; |
458 | 458 | } |
459 | 459 | |
460 | - return null; |
|
460 | + return NULL; |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | /** |
@@ -17,7 +17,6 @@ |
||
17 | 17 | namespace IPub\MobileDetect\Helpers; |
18 | 18 | |
19 | 19 | use Nette; |
20 | - |
|
21 | 20 | use IPub\MobileDetect\Exceptions; |
22 | 21 | |
23 | 22 | /** |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 23.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Helpers; |
18 | 18 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @throws Exceptions\InvalidArgumentException |
77 | 77 | */ |
78 | - public function __construct(string $name, ?string $domain = null, ?string $expireAfter = null, string $path = '/', bool $secure = false, bool $httpOnly = true) |
|
78 | + public function __construct(string $name, ?string $domain = null, ?string $expireAfter = null, string $path = '/', bool $secure = false, bool $httpOnly = true) |
|
79 | 79 | { |
80 | 80 | // from PHP source code |
81 | 81 | if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @throws Exceptions\InvalidArgumentException |
77 | 77 | */ |
78 | - public function __construct(string $name, ?string $domain = null, ?string $expireAfter = null, string $path = '/', bool $secure = false, bool $httpOnly = true) |
|
78 | + public function __construct(string $name, ?string $domain = NULL, ?string $expireAfter = NULL, string $path = '/', bool $secure = FALSE, bool $httpOnly = TRUE) |
|
79 | 79 | { |
80 | 80 | // from PHP source code |
81 | 81 | if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $expire = new \DateTime; |
90 | 90 | |
91 | - if ($expireAfter !== null) { |
|
91 | + if ($expireAfter !== NULL) { |
|
92 | 92 | $expire->modify($expireAfter); |
93 | 93 | } |
94 | 94 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @date 16.06.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Templating; |
18 | 18 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | // Get container builder |
88 | 88 | $builder = $this->getContainerBuilder(); |
89 | 89 | |
90 | - // Set the default configuration |
|
90 | + // Set the default configuration |
|
91 | 91 | $this->validateConfig($this->defaults); |
92 | 92 | |
93 | 93 | // Get extension configuration |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 21.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\DI; |
18 | 18 | |
@@ -47,19 +47,19 @@ discard block |
||
47 | 47 | 'isEnabled' => false, |
48 | 48 | 'host' => null, |
49 | 49 | 'statusCode' => 301, |
50 | - 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
50 | + 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
51 | 51 | ], |
52 | 52 | 'phone' => [ |
53 | 53 | 'isEnabled' => false, |
54 | 54 | 'host' => null, |
55 | 55 | 'statusCode' => 301, |
56 | - 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
56 | + 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
57 | 57 | ], |
58 | 58 | 'tablet' => [ |
59 | 59 | 'isEnabled' => false, |
60 | 60 | 'host' => null, |
61 | 61 | 'statusCode' => 301, |
62 | - 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
62 | + 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
63 | 63 | ], |
64 | 64 | 'detectPhoneAsMobile' => false, |
65 | 65 | 'detectTabletAsMobile' => false, |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | ->setAutowired(FALSE); |
134 | 134 | |
135 | 135 | $application = $builder->getDefinition('application'); |
136 | - $application->addSetup('$service->onRequest[] = ?', ['@' . $this->prefix('onRequestHandler')]); |
|
137 | - $application->addSetup('$service->onResponse[] = ?', ['@' . $this->prefix('onResponseHandler')]); |
|
136 | + $application->addSetup('$service->onRequest[] = ?', ['@'.$this->prefix('onRequestHandler')]); |
|
137 | + $application->addSetup('$service->onResponse[] = ?', ['@'.$this->prefix('onResponseHandler')]); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -44,37 +44,37 @@ |
||
44 | 44 | private $defaults = [ |
45 | 45 | 'redirect' => [ |
46 | 46 | 'mobile' => [ |
47 | - 'isEnabled' => false, |
|
48 | - 'host' => null, |
|
47 | + 'isEnabled' => FALSE, |
|
48 | + 'host' => NULL, |
|
49 | 49 | 'statusCode' => 301, |
50 | 50 | 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
51 | 51 | ], |
52 | 52 | 'phone' => [ |
53 | - 'isEnabled' => false, |
|
54 | - 'host' => null, |
|
53 | + 'isEnabled' => FALSE, |
|
54 | + 'host' => NULL, |
|
55 | 55 | 'statusCode' => 301, |
56 | 56 | 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
57 | 57 | ], |
58 | 58 | 'tablet' => [ |
59 | - 'isEnabled' => false, |
|
60 | - 'host' => null, |
|
59 | + 'isEnabled' => FALSE, |
|
60 | + 'host' => NULL, |
|
61 | 61 | 'statusCode' => 301, |
62 | 62 | 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
63 | 63 | ], |
64 | - 'detectPhoneAsMobile' => false, |
|
65 | - 'detectTabletAsMobile' => false, |
|
64 | + 'detectPhoneAsMobile' => FALSE, |
|
65 | + 'detectTabletAsMobile' => FALSE, |
|
66 | 66 | ], |
67 | 67 | 'switchDeviceView' => [ |
68 | - 'saveRefererPath' => true |
|
68 | + 'saveRefererPath' => TRUE |
|
69 | 69 | ], |
70 | 70 | 'switchParameterName' => 'device_view', |
71 | 71 | 'deviceViewCookie' => [ |
72 | 72 | 'name' => 'device_view', |
73 | - 'domain' => null, |
|
73 | + 'domain' => NULL, |
|
74 | 74 | 'expireAfter' => '+1 month', |
75 | 75 | 'path' => '/', |
76 | - 'secure' => false, |
|
77 | - 'httpOnly' => true, |
|
76 | + 'secure' => FALSE, |
|
77 | + 'httpOnly' => TRUE, |
|
78 | 78 | ], |
79 | 79 | 'debugger' => '%debugMode%' |
80 | 80 | ]; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 21.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Diagnostics; |
18 | 18 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function getTab() |
64 | 64 | { |
65 | 65 | return '<span title="Mobile detect"><img width="16px" height="16px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAACNCAYAAAAeuFBXAAAAGXRFWHRTb2Z0d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Oie9OKD18pbFJYa5o9+Glaxn4Ru7ix2degiit/8sV0IHgxe5tNp7aEzAh298JM/rDWXkwWU+kczFtL6w9cFOmrRH34fbZtuGuN0eHEk0FGLPnH5VHNZKajkG9td+uWlLYGOVvDxSwvN5bcCLet0euWRVYGOVvAH302qct/xXkqvHppELrCobbv6/YvLVdkHFlqPHurQUYp970LrkAersnkmHXn0lED3vdB3z7fdaaPCrfc8Xnss5DZeEcpRv/PtoLmsyfI2cztzMdKh+1rk29+0/8WuyPLfuDu9/viWDt23ML91bijM/0j7nseyDt23At88O6n8KIZ/Yym98cREh+5LmI99vSrMU7v0gg7dh8LGX5X2vsZ/ZT1tPBnmuFbcHzST0loz5rZPtBu7jVE9+nI+ysceVzlu3mz/9DsT98agGSFOtjgki1D8KcAASOpOloXu01cAAAAASUVORK5CYII=" />' |
66 | - . $this->mobileDetect->view() . ' / ' . $this->mobileDetect->platform() . '</span>'; |
|
66 | + . $this->mobileDetect->view().' / '.$this->mobileDetect->platform().'</span>'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -78,19 +78,18 @@ discard block |
||
78 | 78 | $panel = []; |
79 | 79 | |
80 | 80 | $panel[] = '<h2>Original User agent header</h2>'; |
81 | - $panel[] = '<p>' . $h($this->mobileDetect->getUserAgent()) . '</p>'; |
|
81 | + $panel[] = '<p>'.$h($this->mobileDetect->getUserAgent()).'</p>'; |
|
82 | 82 | |
83 | 83 | $properties = ['view', 'platform', 'platformVersion', 'device', 'browser', 'browserVersion']; |
84 | 84 | |
85 | 85 | $panel[] = '<table style="width:100%">'; |
86 | 86 | foreach ($properties as $property) { |
87 | - $panel[] = '<tr><th>' . ucfirst($property) . '</th><td>' . $h($this->mobileDetect->{$property}() ?: '') . '</td></tr>'; |
|
87 | + $panel[] = '<tr><th>'.ucfirst($property).'</th><td>'.$h($this->mobileDetect->{$property}() ?: '').'</td></tr>'; |
|
88 | 88 | } |
89 | 89 | $panel[] = '</table>'; |
90 | 90 | |
91 | - return empty($panel) ? '' : |
|
92 | - '<h1>View: ' . $this->mobileDetect->view() . ', OS: ' . $this->mobileDetect->platform() . '</h1>' . |
|
93 | - '<div class="nette-inner tracy-inner ipub-MobileDetectPanel" style="min-width:500px">' . implode($panel) . '</div>' . |
|
91 | + return empty($panel) ? '' : '<h1>View: '.$this->mobileDetect->view().', OS: '.$this->mobileDetect->platform().'</h1>'. |
|
92 | + '<div class="nette-inner tracy-inner ipub-MobileDetectPanel" style="min-width:500px">'.implode($panel).'</div>'. |
|
94 | 93 | '<style> |
95 | 94 | #nette-debug .ipub-MobileDetectPanel h2, |
96 | 95 | #tracy-debug .ipub-MobileDetectPanel h2 {font-size: 17px;} |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @date 23.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Events; |
18 | 18 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * @var bool |
35 | 35 | */ |
36 | - private $needModifyResponse = false; |
|
36 | + private $needModifyResponse = FALSE; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @var DeviceView |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function needModifyResponse() : void |
62 | 62 | { |
63 | - $this->needModifyResponse = true; |
|
63 | + $this->needModifyResponse = TRUE; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @date 23.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Helpers; |
18 | 18 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $this->switchParameterName = $setSwitchParameterName; |
82 | 82 | |
83 | - if ($this->httpRequest->getQuery($this->switchParameterName) ?? false) { |
|
83 | + if ($this->httpRequest->getQuery($this->switchParameterName) ?? FALSE) { |
|
84 | 84 | $this->viewType = $this->httpRequest->getQuery($this->switchParameterName); |
85 | 85 | |
86 | 86 | } elseif ($this->httpRequest->getCookie($this->cookieSettings->getName())) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function hasSwitchParameter() : bool |
215 | 215 | { |
216 | - return ($this->httpRequest->getQuery($this->switchParameterName) ?? false) ? true : false; |
|
216 | + return ($this->httpRequest->getQuery($this->switchParameterName) ?? FALSE) ? TRUE : FALSE; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 22.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect\Latte; |
18 | 18 | |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | // Create magic method name |
200 | - $magicMethodName = 'is' . ucfirst(strtolower((string) $arguments["device"])); |
|
200 | + $magicMethodName = 'is'.ucfirst(strtolower((string) $arguments["device"])); |
|
201 | 201 | |
202 | 202 | return $writer->write(' |
203 | - $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isDevice, "' . $arguments['device'] . '")) : $template->getMobileDetectService()->'. $magicMethodName.'(); |
|
203 | + $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isDevice, "' . $arguments['device'].'")) : $template->getMobileDetectService()->'.$magicMethodName.'(); |
|
204 | 204 | if ($_resultMD) { |
205 | 205 | '); |
206 | 206 | } |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | // Create magic method name |
225 | - $magicMethodName = 'is' . ucfirst(strtolower((string) $arguments["os"])); |
|
225 | + $magicMethodName = 'is'.ucfirst(strtolower((string) $arguments["os"])); |
|
226 | 226 | |
227 | 227 | return $writer->write(' |
228 | - $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isOs, "' . $arguments['os'] . '")) : $template->getMobileDetectService()->'. $magicMethodName.'(); |
|
228 | + $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isOs, "' . $arguments['os'].'")) : $template->getMobileDetectService()->'.$magicMethodName.'(); |
|
229 | 229 | if ($_resultMD) { |
230 | 230 | '); |
231 | 231 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @date 21.04.14 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\MobileDetect; |
18 | 18 |