@@ -17,7 +17,6 @@ |
||
| 17 | 17 | namespace IPub\MobileDetect\Helpers; |
| 18 | 18 | |
| 19 | 19 | use Nette; |
| 20 | - |
|
| 21 | 20 | use IPub; |
| 22 | 21 | use IPub\MobileDetect\Exceptions; |
| 23 | 22 | |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | * |
| 64 | 64 | * @throws Exceptions\InvalidArgumentException |
| 65 | 65 | */ |
| 66 | - public function __construct(string $name, string $domain = NULL, string $expireAfter = NULL, string $path = '/', bool $secure = FALSE, bool $httpOnly = TRUE) |
|
| 66 | + public function __construct(string $name, string $domain = NULL, string $expireAfter = NULL, string $path = '/', bool $secure = FALSE, bool $httpOnly = TRUE) |
|
| 67 | 67 | { |
| 68 | 68 | // from PHP source code |
| 69 | 69 | if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $url->setQueryParameter($this->deviceView->getSwitchParameterName(), NULL); |
| 372 | 372 | |
| 373 | 373 | // Create full path url |
| 374 | - $redirectUrl = $this->getCurrentHost() . $url->getRelativeUrl(); |
|
| 374 | + $redirectUrl = $this->getCurrentHost().$url->getRelativeUrl(); |
|
| 375 | 375 | |
| 376 | 376 | // Generate only domain path |
| 377 | 377 | } else { |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | if ($routingOption = $this->getRoutingOption($platform)) { |
| 411 | 411 | switch ($routingOption) { |
| 412 | 412 | case self::REDIRECT: |
| 413 | - return rtrim($this->redirectConf[$platform]['host'], '/') . '/' . ltrim($this->httpRequest->getUrl()->getRelativeUrl(), '/'); |
|
| 413 | + return rtrim($this->redirectConf[$platform]['host'], '/').'/'.ltrim($this->httpRequest->getUrl()->getRelativeUrl(), '/'); |
|
| 414 | 414 | |
| 415 | 415 | case self::REDIRECT_WITHOUT_PATH: |
| 416 | 416 | return $this->redirectConf[$platform]['host']; |
@@ -455,6 +455,6 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | private function getCurrentHost() : string |
| 457 | 457 | { |
| 458 | - return $this->httpRequest->getUrl()->getHostUrl() . $this->httpRequest->getUrl()->getScriptPath(); |
|
| 458 | + return $this->httpRequest->getUrl()->getHostUrl().$this->httpRequest->getUrl()->getScriptPath(); |
|
| 459 | 459 | } |
| 460 | 460 | } |
@@ -38,19 +38,19 @@ discard block |
||
| 38 | 38 | 'isEnabled' => FALSE, |
| 39 | 39 | 'host' => NULL, |
| 40 | 40 | 'statusCode' => 301, |
| 41 | - 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
| 41 | + 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
| 42 | 42 | ], |
| 43 | 43 | 'phone' => [ |
| 44 | 44 | 'isEnabled' => FALSE, |
| 45 | 45 | 'host' => NULL, |
| 46 | 46 | 'statusCode' => 301, |
| 47 | - 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
| 47 | + 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
| 48 | 48 | ], |
| 49 | 49 | 'tablet' => [ |
| 50 | 50 | 'isEnabled' => FALSE, |
| 51 | 51 | 'host' => NULL, |
| 52 | 52 | 'statusCode' => 301, |
| 53 | - 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
| 53 | + 'action' => 'noRedirect', // redirect/noRedirect/redirectWithoutPath |
|
| 54 | 54 | ], |
| 55 | 55 | 'detectPhoneAsMobile' => FALSE, |
| 56 | 56 | 'detectTabletAsMobile' => FALSE, |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | ->setAutowired(FALSE); |
| 113 | 113 | |
| 114 | 114 | $application = $builder->getDefinition('application'); |
| 115 | - $application->addSetup('$service->onRequest[] = ?', ['@' . $this->prefix('onRequestHandler')]); |
|
| 116 | - $application->addSetup('$service->onResponse[] = ?', ['@' . $this->prefix('onResponseHandler')]); |
|
| 115 | + $application->addSetup('$service->onRequest[] = ?', ['@'.$this->prefix('onRequestHandler')]); |
|
| 116 | + $application->addSetup('$service->onResponse[] = ?', ['@'.$this->prefix('onResponseHandler')]); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -201,10 +201,10 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | // Create magic method name |
| 204 | - $magicMethodName = 'is' . ucfirst(strtolower((string) $arguments["device"])); |
|
| 204 | + $magicMethodName = 'is'.ucfirst(strtolower((string) $arguments["device"])); |
|
| 205 | 205 | |
| 206 | 206 | return $writer->write(' |
| 207 | - $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isDevice, "' . $arguments['device'] . '")) : $template->getMobileDetectService()->'. $magicMethodName.'(); |
|
| 207 | + $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isDevice, "' . $arguments['device'].'")) : $template->getMobileDetectService()->'.$magicMethodName.'(); |
|
| 208 | 208 | if ($_resultMD) { |
| 209 | 209 | '); |
| 210 | 210 | } |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | // Create magic method name |
| 229 | - $magicMethodName = 'is' . ucfirst(strtolower((string) $arguments["os"])); |
|
| 229 | + $magicMethodName = 'is'.ucfirst(strtolower((string) $arguments["os"])); |
|
| 230 | 230 | |
| 231 | 231 | return $writer->write(' |
| 232 | - $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isOs, "' . $arguments['os'] . '")) : $template->getMobileDetectService()->'. $magicMethodName.'(); |
|
| 232 | + $_resultMD = property_exists($this, "filters") ? %escape(call_user_func($this->filters->isOs, "' . $arguments['os'].'")) : $template->getMobileDetectService()->'.$magicMethodName.'(); |
|
| 233 | 233 | if ($_resultMD) { |
| 234 | 234 | '); |
| 235 | 235 | } |