@@ -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)) { |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | // Create magic method name |
186 | - $magicMethodName = 'is' . ucfirst(strtolower((string) $arguments['device'])); |
|
186 | + $magicMethodName = 'is'.ucfirst(strtolower((string) $arguments['device'])); |
|
187 | 187 | |
188 | - return $writer->write('if ($template->getMobileDetectService()->' . $magicMethodName . '()) {'); |
|
188 | + return $writer->write('if ($template->getMobileDetectService()->'.$magicMethodName.'()) {'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | // Create magic method name |
208 | - $magicMethodName = 'is' . ucfirst(strtolower((string) $arguments['os'])); |
|
208 | + $magicMethodName = 'is'.ucfirst(strtolower((string) $arguments['os'])); |
|
209 | 209 | |
210 | - return $writer->write('if ($template->getMobileDetectService()->' . $magicMethodName . '()) {'); |
|
210 | + return $writer->write('if ($template->getMobileDetectService()->'.$magicMethodName.'()) {'); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -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, |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | // Register template helpers |
111 | 111 | $builder->addDefinition($this->prefix('helpers')) |
112 | 112 | ->setClass(Templating\Helpers::class) |
113 | - ->setFactory($this->prefix('@mobileDetect') . '::createTemplateHelpers') |
|
113 | + ->setFactory($this->prefix('@mobileDetect').'::createTemplateHelpers') |
|
114 | 114 | ->setInject(FALSE); |
115 | 115 | |
116 | 116 | $application = $builder->getDefinition('application'); |
117 | - $application->addSetup('$service->onRequest[] = ?', ['@' . $this->prefix('onRequestHandler')]); |
|
118 | - $application->addSetup('$service->onResponse[] = ?', ['@' . $this->prefix('onResponseHandler')]); |
|
117 | + $application->addSetup('$service->onRequest[] = ?', ['@'.$this->prefix('onRequestHandler')]); |
|
118 | + $application->addSetup('$service->onResponse[] = ?', ['@'.$this->prefix('onResponseHandler')]); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -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 | } |