Completed
Push — master ( 8243fd...e02a77 )
by Adam
07:58
created
src/IPub/MobileDetect/Latte/Macros.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
 		}
169 169
 
170 170
 		// Create magic method name
171
-		$magicMethodName = 'is' . ucfirst(strtolower((string) $arguments["device"]));
171
+		$magicMethodName = 'is'.ucfirst(strtolower((string) $arguments["device"]));
172 172
 
173
-		return $writer->write('if ($template->getMobileDetectService()->'. $magicMethodName.'()) {');
173
+		return $writer->write('if ($template->getMobileDetectService()->'.$magicMethodName.'()) {');
174 174
 	}
175 175
 
176 176
 	/**
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 		}
191 191
 
192 192
 		// Create magic method name
193
-		$magicMethodName = 'is' . ucfirst(strtolower((string) $arguments["os"]));
193
+		$magicMethodName = 'is'.ucfirst(strtolower((string) $arguments["os"]));
194 194
 
195
-		return $writer->write('if ($template->getMobileDetectService()->'. $magicMethodName.'()) {');
195
+		return $writer->write('if ($template->getMobileDetectService()->'.$magicMethodName.'()) {');
196 196
 	}
197 197
 
198 198
 	/**
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
 	 */
268 268
 	public static function prepareMacroArguments($macro)
269 269
 	{
270
-		$arguments = array_map(function ($value) {
270
+		$arguments = array_map(function($value) {
271 271
 			return trim($value);
272 272
 		}, explode(",", $macro));
273 273
 
274
-		$device	= $os = $arguments[0];
274
+		$device = $os = $arguments[0];
275 275
 
276 276
 		return array(
277 277
 			"device"	=> $device,
Please login to merge, or discard this patch.
src/IPub/MobileDetect/TMobileDetect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	 */
37 37
 	public function injectMobileDetector(MobileDetect $mobileDetect, Helpers\DeviceView $deviceView)
38 38
 	{
39
-		$this->mobileDetect	= $mobileDetect;
40
-		$this->deviceView	= $deviceView;
39
+		$this->mobileDetect = $mobileDetect;
40
+		$this->deviceView = $deviceView;
41 41
 	}
42 42
 }
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Helpers/DeviceView.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 class DeviceView extends Nette\Object
22 22
 {
23
-	const COOKIE_KEY		= 'device_view';
23
+	const COOKIE_KEY = 'device_view';
24 24
 
25
-	const SWITCH_PARAM		= 'device_view';
25
+	const SWITCH_PARAM = 'device_view';
26 26
 
27 27
 	const VIEW_MOBILE		= 'mobile';
28 28
 	const VIEW_PHONE		= 'phone';
29 29
 	const VIEW_TABLET		= 'tablet';
30 30
 	const VIEW_FULL			= 'full';
31
-	const VIEW_NOT_MOBILE	= 'not_mobile';
31
+	const VIEW_NOT_MOBILE = 'not_mobile';
32 32
 
33 33
 	/**
34 34
 	 * @var Http\IRequest
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function __construct(Http\IRequest $httpRequest, Http\IResponse $httpResponse)
53 53
 	{
54
-		$this->httpRequest	= $httpRequest;
55
-		$this->httpResponse	= $httpResponse;
54
+		$this->httpRequest = $httpRequest;
55
+		$this->httpResponse = $httpResponse;
56 56
 
57 57
 		if ($this->httpRequest->getQuery(self::SWITCH_PARAM)) {
58 58
 			$this->viewType = $this->httpRequest->getQuery(self::SWITCH_PARAM);
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Helpers/Cookie.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 		$this->expire	= $expire;
71 71
 		$this->path		= empty($path) ? '/' : $path;
72 72
 		$this->secure	= (bool) $secure;
73
-		$this->httpOnly	= (bool) $httpOnly;
73
+		$this->httpOnly = (bool) $httpOnly;
74 74
 	}
75 75
 
76 76
 	/**
Please login to merge, or discard this patch.
src/IPub/MobileDetect/DI/MobileDetectExtension.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 				'isEnabled'		=> FALSE,
32 32
 				'host'			=> NULL,
33 33
 				'statusCode'	=> 301,
34
-				'action'		=> 'noRedirect',	// redirect/noRedirect/redirectWithoutPath
34
+				'action'		=> 'noRedirect', // redirect/noRedirect/redirectWithoutPath
35 35
 			),
36 36
 			'tablet'	=> array(
37 37
 				'isEnabled'		=> FALSE,
38 38
 				'host'			=> NULL,
39 39
 				'statusCode'	=> 301,
40
-				'action'		=> 'noRedirect',	// redirect/noRedirect/redirectWithoutPath
40
+				'action'		=> 'noRedirect', // redirect/noRedirect/redirectWithoutPath
41 41
 			),
42 42
 			'detectTabletAsMobile'	=> FALSE,
43 43
 		),
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
 		// Register template helpers
70 70
 		$builder->addDefinition($this->prefix('helpers'))
71 71
 			->setClass('IPub\MobileDetect\Templating\Helpers')
72
-			->setFactory($this->prefix('@mobileDetect') . '::createTemplateHelpers')
72
+			->setFactory($this->prefix('@mobileDetect').'::createTemplateHelpers')
73 73
 			->setInject(FALSE);
74 74
 
75 75
 		$application = $builder->getDefinition('application');
76
-		$application->addSetup('$service->onRequest[] = ?', array('@' . $this->prefix('onRequestHandler')));
77
-		$application->addSetup('$service->onResponse[] = ?', array('@' . $this->prefix('onResponseHandler')));
76
+		$application->addSetup('$service->onRequest[] = ?', array('@'.$this->prefix('onRequestHandler')));
77
+		$application->addSetup('$service->onResponse[] = ?', array('@'.$this->prefix('onResponseHandler')));
78 78
 	}
79 79
 
80 80
 	public function beforeCompile()
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public static function register(Nette\Configurator $config, $extensionName = 'mobileDetect')
100 100
 	{
101
-		$config->onCompile[] = function (Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) {
101
+		$config->onCompile[] = function(Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) {
102 102
 			$compiler->addExtension($extensionName, new MobileDetectExtension());
103 103
 		};
104 104
 	}
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Events/OnRequestHandler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 
25 25
 class OnRequestHandler
26 26
 {
27
-	const REDIRECT				= 'redirect';
28
-	const NO_REDIRECT			= 'noRedirect';
29
-	const REDIRECT_WITHOUT_PATH	= 'redirectWithoutPath';
27
+	const REDIRECT = 'redirect';
28
+	const NO_REDIRECT = 'noRedirect';
29
+	const REDIRECT_WITHOUT_PATH = 'redirectWithoutPath';
30 30
 
31 31
 	const MOBILE	= 'mobile';
32 32
 	const TABLET	= 'tablet';
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
 		MobileDetect $mobileDetect,
88 88
 		DeviceView $deviceView
89 89
 	) {
90
-		$this->httpRequest	= $httpRequest;
91
-		$this->httpResponse	= $httpResponse;
90
+		$this->httpRequest = $httpRequest;
91
+		$this->httpResponse = $httpResponse;
92 92
 
93 93
 		$this->router = $router;
94 94
 
95 95
 		$this->onResponseHandler = $onResponseHandler;
96 96
 
97
-		$this->mobileDetect	= $mobileDetect;
98
-		$this->deviceView	= $deviceView;
97
+		$this->mobileDetect = $mobileDetect;
98
+		$this->deviceView = $deviceView;
99 99
 	}
100 100
 
101 101
 	/**
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			$url->setQueryParameter(DeviceView::SWITCH_PARAM, NULL);
324 324
 
325 325
 			// Create full path url
326
-			$redirectUrl = $this->getCurrentHost() . $url->getRelativeUrl();
326
+			$redirectUrl = $this->getCurrentHost().$url->getRelativeUrl();
327 327
 
328 328
 		// Generate only domain path
329 329
 		} else {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 			switch ($routingOption)
377 377
 			{
378 378
 				case self::REDIRECT:
379
-					return rtrim($this->redirectConf[$platform]['host'], '/') .'/'. ltrim($this->httpRequest->getUrl()->getRelativeUrl(), '/');
379
+					return rtrim($this->redirectConf[$platform]['host'], '/').'/'.ltrim($this->httpRequest->getUrl()->getRelativeUrl(), '/');
380 380
 
381 381
 				case self::REDIRECT_WITHOUT_PATH:
382 382
 					return  $this->redirectConf[$platform]['host'];
@@ -421,6 +421,6 @@  discard block
 block discarded – undo
421 421
 	 */
422 422
 	protected function getCurrentHost()
423 423
 	{
424
-		return $this->httpRequest->getUrl()->getHostUrl() . $this->httpRequest->getUrl()->getScriptPath();
424
+		return $this->httpRequest->getUrl()->getHostUrl().$this->httpRequest->getUrl()->getScriptPath();
425 425
 	}
426 426
 }
427 427
\ No newline at end of file
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Templating/Helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@
 block discarded – undo
39 39
 		MobileDetect\MobileDetect $mobileDetect,
40 40
 		MobileDetect\Helpers\DeviceView $deviceView
41 41
 	) {
42
-		$this->mobileDetect	= $mobileDetect;
43
-		$this->deviceView	= $deviceView;
42
+		$this->mobileDetect = $mobileDetect;
43
+		$this->deviceView = $deviceView;
44 44
 	}
45 45
 
46 46
 	public function loader($method)
47 47
 	{
48
-		if ( method_exists($this, $method) ) {
48
+		if (method_exists($this, $method)) {
49 49
 			return callback($this, $method);
50 50
 		}
51 51
 	}
Please login to merge, or discard this patch.