diff --git a/src/Agent.php b/src/Agent.php index 6c47492..feb7196 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -106,6 +106,32 @@ public static function getDetectionRulesExtended() return $rules; } + + /** + * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*(). + * + * Since this function should only return rules that can detect mobile devices, do not pollute it + * with non-mobile stuff. + * + * @return array All the rules (but not extended). + */ + public static function getMobileDetectionRules() + { + static $rules; + + if (!$rules) { + $rules = array_merge( + parent::getPhoneDevices(), + parent::getTabletDevices(), + parent::getOperatingSystems(), + parent::getBrowsers() + ); + } + + return $rules; + + } + public function getRules() { if ($this->detectionType === static::DETECTION_TYPE_EXTENDED) {