@@ -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 | } |
@@ -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)) { |
@@ -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 | |
@@ -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 | /** |
@@ -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,iVBORw0KGgoAAAANSUhEUgAAALQAAACNCAYAAAAeuFBXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFMzg3RTE0RTg0MUYxMUUyQkRDMEVDMzQ5RjcxOEI3OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowOUUwNjQ2QTg0MjAxMUUyQkRDMEVDMzQ5RjcxOEI3OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkUzODdF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5rxPThEyYn4VDL5pHUA6gM+VIyUxAoAGBBvYh0FuVkybDQAvgYj/LOunOVf3ZL+12UHtTzwUpaT09d9+mQJca6E+vth/+S4FKutGMQXr+/usCXdoEfHJl0Fx+D1ja6fTCA6sCXdoEfPzzpIr78Oie9OKD18pbFJYa5o9+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 | |
@@ -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 | |
@@ -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 | |