@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $match = null; |
119 | 119 | $matches = []; |
120 | 120 | |
121 | - while ($i < $regexLength && ! $matches) { |
|
121 | + while ($i < $regexLength && !$matches) { |
|
122 | 122 | $reg = $regex[$i]; |
123 | 123 | $property = $regex[$i + 1]; |
124 | 124 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $k = 0; |
127 | 127 | |
128 | 128 | $regLength = count($reg); |
129 | - while ($j < $regLength && ! $matches) { |
|
129 | + while ($j < $regLength && !$matches) { |
|
130 | 130 | $pattern = $reg[$j++]; |
131 | 131 | if (is_string($pattern)) { |
132 | 132 | preg_match($pattern, $userAgent, $matches); |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * Class AbstractDetector |
60 | 60 | * @package Platine\UserAgent\Detector |
61 | 61 | */ |
62 | -abstract class AbstractDetector |
|
63 | -{ |
|
62 | +abstract class AbstractDetector { |
|
64 | 63 | |
65 | 64 | /** |
66 | 65 | * Data type and definitions |
@@ -99,8 +98,7 @@ discard block |
||
99 | 98 | /** |
100 | 99 | * Create new instance |
101 | 100 | */ |
102 | - public function __construct() |
|
103 | - { |
|
101 | + public function __construct() { |
|
104 | 102 | $this->maps = $this->maps(); |
105 | 103 | $this->regex = $this->regex(); |
106 | 104 | } |
@@ -199,8 +197,7 @@ discard block |
||
199 | 197 | * Return the entity instance |
200 | 198 | * @return Browser|Cpu|Os|Device|Engine |
201 | 199 | */ |
202 | - public function entity() |
|
203 | - { |
|
200 | + public function entity() { |
|
204 | 201 | return $this->entity; |
205 | 202 | } |
206 | 203 | |
@@ -245,8 +242,7 @@ discard block |
||
245 | 242 | * @param string $str |
246 | 243 | * @return string|string[]|null |
247 | 244 | */ |
248 | - protected function trim(string $str) |
|
249 | - { |
|
245 | + protected function trim(string $str) { |
|
250 | 246 | return preg_replace( |
251 | 247 | '/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/', |
252 | 248 | '', |
@@ -53,14 +53,12 @@ |
||
53 | 53 | * Class CpuDetector |
54 | 54 | * @package Platine\UserAgent\Detector |
55 | 55 | */ |
56 | -class CpuDetector extends AbstractDetector |
|
57 | -{ |
|
56 | +class CpuDetector extends AbstractDetector { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | - public function __construct() |
|
63 | - { |
|
61 | + public function __construct() { |
|
64 | 62 | parent::__construct(); |
65 | 63 | |
66 | 64 | $this->entity = new Cpu(); |
@@ -57,8 +57,8 @@ |
||
57 | 57 | { |
58 | 58 | |
59 | 59 | /** |
60 | - * {@inheritdoc} |
|
61 | - */ |
|
60 | + * {@inheritdoc} |
|
61 | + */ |
|
62 | 62 | public function __construct() |
63 | 63 | { |
64 | 64 | parent::__construct(); |
@@ -53,14 +53,12 @@ |
||
53 | 53 | * Class OsDetector |
54 | 54 | * @package Platine\UserAgent\Detector |
55 | 55 | */ |
56 | -class OsDetector extends AbstractDetector |
|
57 | -{ |
|
56 | +class OsDetector extends AbstractDetector { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | - public function __construct() |
|
63 | - { |
|
61 | + public function __construct() { |
|
64 | 62 | parent::__construct(); |
65 | 63 | |
66 | 64 | $this->entity = new Os(); |
@@ -57,8 +57,8 @@ |
||
57 | 57 | { |
58 | 58 | |
59 | 59 | /** |
60 | - * {@inheritdoc} |
|
61 | - */ |
|
60 | + * {@inheritdoc} |
|
61 | + */ |
|
62 | 62 | public function __construct() |
63 | 63 | { |
64 | 64 | parent::__construct(); |
@@ -53,14 +53,12 @@ |
||
53 | 53 | * Class EngineDetector |
54 | 54 | * @package Platine\UserAgent\Detector |
55 | 55 | */ |
56 | -class EngineDetector extends AbstractDetector |
|
57 | -{ |
|
56 | +class EngineDetector extends AbstractDetector { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | - public function __construct() |
|
63 | - { |
|
61 | + public function __construct() { |
|
64 | 62 | parent::__construct(); |
65 | 63 | |
66 | 64 | $this->entity = new Engine(); |
@@ -56,9 +56,9 @@ |
||
56 | 56 | class DeviceDetector extends AbstractDetector |
57 | 57 | { |
58 | 58 | |
59 | - /** |
|
60 | - * {@inheritdoc} |
|
61 | - */ |
|
59 | + /** |
|
60 | + * {@inheritdoc} |
|
61 | + */ |
|
62 | 62 | public function __construct() |
63 | 63 | { |
64 | 64 | parent::__construct(); |
@@ -53,14 +53,12 @@ |
||
53 | 53 | * Class DeviceDetector |
54 | 54 | * @package Platine\UserAgent\Detector |
55 | 55 | */ |
56 | -class DeviceDetector extends AbstractDetector |
|
57 | -{ |
|
56 | +class DeviceDetector extends AbstractDetector { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | - public function __construct() |
|
63 | - { |
|
61 | + public function __construct() { |
|
64 | 62 | parent::__construct(); |
65 | 63 | |
66 | 64 | $this->entity = new Device(); |
@@ -53,14 +53,12 @@ |
||
53 | 53 | * Class BrowserDetector |
54 | 54 | * @package Platine\UserAgent\Detector |
55 | 55 | */ |
56 | -class BrowserDetector extends AbstractDetector |
|
57 | -{ |
|
56 | +class BrowserDetector extends AbstractDetector { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | - public function __construct() |
|
63 | - { |
|
61 | + public function __construct() { |
|
64 | 62 | parent::__construct(); |
65 | 63 | |
66 | 64 | $this->entity = new Browser(); |