Completed
Push — master ( f289b4...9edc41 )
by Adam
07:45
created
src/IPub/MobileDetect/Helpers/CookieSettings.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Events/OnRequestHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/IPub/MobileDetect/DI/MobileDetectExtension.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 	/**
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,6 @@
 block discarded – undo
19 19
 use Nette;
20 20
 use Nette\Bridges;
21 21
 use Nette\DI;
22
-use Nette\PhpGenerator as Code;
23
-
24 22
 use IPub;
25 23
 use IPub\MobileDetect;
26 24
 use IPub\MobileDetect\Events;
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Latte/Macros.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
src/IPub/MobileDetect/Diagnostics/Panel.php 2 patches
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	public function getTab()
48 48
 	{
49 49
 		return '<span title="Mobile detect"><img width="16px" height="16px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAACNCAYAAAAeuFBXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFMzg3RTE0RTg0MUYxMUUyQkRDMEVDMzQ5RjcxOEI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Do0Ijk0EMqh3RjoONH2oUE5gEKUw52BbhNt2w6hEGhwaMqBMhwa6DjRnhSCQwOZO7TOij4Yh207FNmhZ8dWM8amFSECnZ69tw30yLSCQwMcGhBoxFcOE4E+KMeeF4USjRiJphzg0EDmDk050AfjoBygHEDflWO3Lv/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=" />'
50
-			. $this->mobileDetect->view() . ' / ' . $this->mobileDetect->platform() . '</span>';
50
+			. $this->mobileDetect->view().' / '.$this->mobileDetect->platform().'</span>';
51 51
 	}
52 52
 
53 53
 	/**
@@ -62,20 +62,19 @@  discard block
 block discarded – undo
62 62
 		$panel = [];
63 63
 
64 64
 		$panel[] = '<h2>Original User agent header</h2>';
65
-		$panel[] = '<p>' . $h($this->mobileDetect->getUserAgent()) . '</p>';
65
+		$panel[] = '<p>'.$h($this->mobileDetect->getUserAgent()).'</p>';
66 66
 
67 67
 		$properties = ['view', 'platform', 'platformVersion', 'device', 'browser', 'browserVersion'];
68 68
 
69 69
 		$panel[] = '<table style="width:100%">';
70 70
 		foreach ($properties as $property)
71 71
 		{
72
-			$panel[] = '<tr><th>' . ucfirst($property) . '</th><td>' . $h($this->mobileDetect->{$property}() ?: '') . '</td></tr>';
72
+			$panel[] = '<tr><th>'.ucfirst($property).'</th><td>'.$h($this->mobileDetect->{$property}() ?: '').'</td></tr>';
73 73
 		}
74 74
 		$panel[] = '</table>';
75 75
 
76
-		return empty($panel) ? '' :
77
-			'<h1>View: '.$this->mobileDetect->view() . ', OS: ' . $this->mobileDetect->platform().'</h1>' .
78
-			'<div class="nette-inner tracy-inner ipub-MobileDetectPanel" style="min-width:500px">' . implode($panel) . '</div>' .
76
+		return empty($panel) ? '' : '<h1>View: '.$this->mobileDetect->view().', OS: '.$this->mobileDetect->platform().'</h1>'.
77
+			'<div class="nette-inner tracy-inner ipub-MobileDetectPanel" style="min-width:500px">'.implode($panel).'</div>'.
79 78
 			'<style>
80 79
 				#nette-debug .ipub-MobileDetectPanel h2,
81 80
 				#tracy-debug .ipub-MobileDetectPanel h2 {font-size: 17px;}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@
 block discarded – undo
67 67
 		$properties = ['view', 'platform', 'platformVersion', 'device', 'browser', 'browserVersion'];
68 68
 
69 69
 		$panel[] = '<table style="width:100%">';
70
-		foreach ($properties as $property)
71
-		{
70
+		foreach ($properties as $property) {
72 71
 			$panel[] = '<tr><th>' . ucfirst($property) . '</th><td>' . $h($this->mobileDetect->{$property}() ?: '') . '</td></tr>';
73 72
 		}
74 73
 		$panel[] = '</table>';
Please login to merge, or discard this patch.