Skip to content

Commit

Permalink
make compatible to extends (#936)
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Querner <[email protected]>
  • Loading branch information
pquerner and Pascal Querner authored Aug 11, 2023
1 parent ee5cf34 commit ba9281b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Mobile_Detect.php
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,10 @@ public static function getMobileDetectionRules()

if (!$rules) {
$rules = array_merge(
self::$phoneDevices,
self::$tabletDevices,
self::$operatingSystems,
self::$browsers
static::getPhoneDevices(),
static::getTabletDevices(),
static::getOperatingSystems(),
static::getBrowsers()
);
}

Expand All @@ -1208,11 +1208,11 @@ public function getMobileDetectionRulesExtended()
if (!$rules) {
// Merge all rules together.
$rules = array_merge(
self::$phoneDevices,
self::$tabletDevices,
self::$operatingSystems,
self::$browsers,
self::$utilities
static::getPhoneDevices(),
static::getTabletDevices(),
static::getOperatingSystems(),
static::getBrowsers(),
static::getUtilities()
);
}

Expand Down Expand Up @@ -1406,7 +1406,7 @@ public function isTablet($userAgent = null, $httpHeaders = null)

$this->setDetectionType(self::DETECTION_TYPE_MOBILE);

foreach (self::$tabletDevices as $_regex) {
foreach (static::getTabletDevices() as $_regex) {
if ($this->match($_regex, $userAgent)) {
return true;
}
Expand Down Expand Up @@ -1531,7 +1531,7 @@ public function version($propertyName, $type = self::VERSION_TYPE_STRING)
$type = self::VERSION_TYPE_STRING;
}

$properties = self::getProperties();
$properties = static::getProperties();

// Check if the property exists in the properties array.
if (true === isset($properties[$propertyName])) {
Expand Down

0 comments on commit ba9281b

Please sign in to comment.