@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | return [ |
| 95 | 95 | [ |
| 96 | 96 | // Presto based |
| 97 | - '/(opera\smini)\/([\w\.-]+)/i', // Opera Mini |
|
| 98 | - '/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i', // Opera Mobi/Tablet |
|
| 99 | - '/(opera).+version\/([\w\.]+)/i', // Opera > 9.80 |
|
| 97 | + '/(opera\smini)\/([\w\.-]+)/i', // Opera Mini |
|
| 98 | + '/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i', // Opera Mobi/Tablet |
|
| 99 | + '/(opera).+version\/([\w\.]+)/i', // Opera > 9.80 |
|
| 100 | 100 | '/(opera)[\/\s]+([\w\.]+)/i' // Opera < 9.80 |
| 101 | 101 | ], [self::NAME, self::VERSION], [ |
| 102 | 102 | '/(opios)[\/\s]+([\w\.]+)/i' // Opera mini on iphone >= 8.0 |
@@ -104,18 +104,18 @@ discard block |
||
| 104 | 104 | '/\s(opr)\/([\w\.]+)/i' // Opera Webkit |
| 105 | 105 | ], [[self::NAME, 'Opera'], self::VERSION], [ |
| 106 | 106 | // Mixed |
| 107 | - '/(kindle)\/([\w\.]+)/i', // Kindle |
|
| 107 | + '/(kindle)\/([\w\.]+)/i', // Kindle |
|
| 108 | 108 | '/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i', |
| 109 | 109 | // Lunascape/Maxthon/Netfront/Jasmine/Blazer |
| 110 | 110 | |
| 111 | 111 | // Trident based |
| 112 | 112 | '/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i', |
| 113 | 113 | // Avant/IEMobile/SlimBrowser/Baidu |
| 114 | - '/(?:ms|\()(ie)\s([\w\.]+)/i', // Internet Explorer |
|
| 114 | + '/(?:ms|\()(ie)\s([\w\.]+)/i', // Internet Explorer |
|
| 115 | 115 | |
| 116 | 116 | // Webkit/KHTML based |
| 117 | - '/(rekonq)\/([\w\.]*)/i', // Rekonq |
|
| 118 | - '/(Instagram)\s([\w\.]+)/i', // Instagram inApp Browser |
|
| 117 | + '/(rekonq)\/([\w\.]*)/i', // Rekonq |
|
| 118 | + '/(Instagram)\s([\w\.]+)/i', // Instagram inApp Browser |
|
| 119 | 119 | '/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i' |
| 120 | 120 | // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon |
| 121 | 121 | ], [self::NAME, self::VERSION], [ |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | '/;(fbav)\/([\w\.]+);/i' // Facebook App for iOS & Android |
| 179 | 179 | ], [[self::NAME, 'Facebook'], self::VERSION], [ |
| 180 | 180 | |
| 181 | - '/safari\s(line)\/([\w\.]+)/i', // Line App for iOS |
|
| 181 | + '/safari\s(line)\/([\w\.]+)/i', // Line App for iOS |
|
| 182 | 182 | '/android.+(line)\/([\w\.]+)\/iab/i' // Line App for Android |
| 183 | 183 | ], [self::NAME, self::VERSION], [ |
| 184 | 184 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | ], [[self::NAME, '/(.+)/', '$1 WebView'], self::VERSION], [ |
| 190 | 190 | |
| 191 | 191 | '/((?:oculus|samsung)browser)\/([\w\.]+)/i' |
| 192 | - ], [[self::NAME, "/(.+(?:g|us))(.+)/", '$1 $2'], self::VERSION], [ // Oculus / Samsung Browser |
|
| 192 | + ], [[self::NAME, "/(.+(?:g|us))(.+)/", '$1 $2'], self::VERSION], [// Oculus / Samsung Browser |
|
| 193 | 193 | |
| 194 | 194 | '/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i' // Android Browser |
| 195 | 195 | ], [self::VERSION, [self::NAME, 'Android Browser']], [ |
@@ -231,20 +231,20 @@ discard block |
||
| 231 | 231 | // Gecko based |
| 232 | 232 | '/(navigator|netscape)\/([\w\.-]+)/i' // Netscape |
| 233 | 233 | ], [[self::NAME, 'Netscape'], self::VERSION], [ |
| 234 | - '/(swiftfox)/i', // Swiftfox |
|
| 234 | + '/(swiftfox)/i', // Swiftfox |
|
| 235 | 235 | '/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i', |
| 236 | 236 | // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror |
| 237 | 237 | '/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i', |
| 238 | 238 | |
| 239 | 239 | // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix |
| 240 | - '/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i', // Mozilla |
|
| 240 | + '/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i', // Mozilla |
|
| 241 | 241 | |
| 242 | 242 | // Other |
| 243 | 243 | '/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i', |
| 244 | 244 | // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir |
| 245 | - '/(links)\s\(([\w\.]+)/i', // Links |
|
| 246 | - '/(gobrowser)\/?([\w\.]*)/i', // GoBrowser |
|
| 247 | - '/(ice\s?browser)\/v?([\w\._]+)/i', // ICE Browser |
|
| 245 | + '/(links)\s\(([\w\.]+)/i', // Links |
|
| 246 | + '/(gobrowser)\/?([\w\.]*)/i', // GoBrowser |
|
| 247 | + '/(ice\s?browser)\/v?([\w\._]+)/i', // ICE Browser |
|
| 248 | 248 | '/(mosaic)[\/\s]([\w\.]+)/i' // Mosaic |
| 249 | 249 | ], [self::NAME, self::VERSION], |
| 250 | 250 | ]; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * The current entity |
| 93 | 93 | * @var Browser|Cpu|Os|Device|Engine |
| 94 | 94 | */ |
| 95 | - protected Browser|Cpu|Os|Device|Engine $entity; |
|
| 95 | + protected Browser | Cpu | Os | Device | Engine $entity; |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * Create new instance |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $match = ''; |
| 117 | 117 | $matches = []; |
| 118 | 118 | |
| 119 | - while ($i < $regexLength && ! $matches) { |
|
| 119 | + while ($i < $regexLength && !$matches) { |
|
| 120 | 120 | $reg = $regex[$i]; |
| 121 | 121 | $property = $regex[$i + 1]; |
| 122 | 122 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $k = 0; |
| 125 | 125 | |
| 126 | 126 | $regLength = count($reg); |
| 127 | - while ($j < $regLength && ! $matches) { |
|
| 127 | + while ($j < $regLength && !$matches) { |
|
| 128 | 128 | $pattern = $reg[$j++]; |
| 129 | 129 | if (is_string($pattern)) { |
| 130 | 130 | preg_match($pattern, $userAgent, $matches); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | $this->fillEntity([$q[0] => $result]); |
| 167 | 167 | } else { |
| 168 | - $replacedMatch = preg_replace($q[1], $q[2], (string)$match); |
|
| 168 | + $replacedMatch = preg_replace($q[1], $q[2], (string) $match); |
|
| 169 | 169 | if ($replacedMatch !== null) { |
| 170 | 170 | $this->fillEntity([$q[0] => $replacedMatch]); |
| 171 | 171 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } elseif (count($q) === 4) { |
| 174 | 174 | if (Helper::startsWith($q[3], '__')) { |
| 175 | 175 | $functionName = Helper::replaceFirst('__', '', $q[3]); |
| 176 | - $result = preg_replace($q[1], $q[2], (string)$match); |
|
| 176 | + $result = preg_replace($q[1], $q[2], (string) $match); |
|
| 177 | 177 | if (method_exists($this, $functionName)) { |
| 178 | 178 | $result = $this->{$functionName}($result); |
| 179 | 179 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * Return the entity instance |
| 197 | 197 | * @return Browser|Cpu|Os|Device|Engine |
| 198 | 198 | */ |
| 199 | - public function entity(): Browser|Cpu|Os|Device|Engine |
|
| 199 | + public function entity(): Browser | Cpu | Os | Device | Engine |
|
| 200 | 200 | { |
| 201 | 201 | return $this->entity; |
| 202 | 202 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | * @param string $str |
| 243 | 243 | * @return string|string[]|null |
| 244 | 244 | */ |
| 245 | - protected function trim(string $str): string|array|null |
|
| 245 | + protected function trim(string $str): string | array | null |
|
| 246 | 246 | { |
| 247 | 247 | return preg_replace( |
| 248 | 248 | '/^[\s\xA0]+|[\s\xA0]+$/', |