original_string: protected static function detectDevice()
    {
      $detect = new MobileDetect();
      self::$detectCode = array();
      self::$detectCode['tablet'] = $detect->isTablet();
      self::$detectCode['mobile'] = $detect->isMobile() && !$detect->isTablet();
      self::$detectCode['desktop'] = !self::$detectCode['tablet'] && !self::$detectCode['mobile'];
      self::$detectCode['device'] = 'desktop';
      foreach ($detect->getRules() as $name => $regex) {
        if ($detect->{'is' . $name}()) {
          self::$detectCode['device'] = $name;
          break;
        }
      }
    }
code: protected static function detectDevice()
    {
      $detect = new MobileDetect();
      self::$detectCode = array();
      self::$detectCode['tablet'] = $detect->isTablet();
      self::$detectCode['mobile'] = $detect->isMobile() && !$detect->isTablet();
      self::$detectCode['desktop'] = !self::$detectCode['tablet'] && !self::$detectCode['mobile'];
      self::$detectCode['device'] = 'desktop';
      foreach ($detect->getRules() as $name => $regex) {
        if ($detect->{'is' . $name}()) {
          self::$detectCode['device'] = $name;
          break;
        }
      }
    }
code_tokens: protected static function detectDevice ( ) { $ detect = new MobileDetect ( ) ; self :: $ detectCode = array ( ) ; self :: $ detectCode [ 'tablet' ] = $ detect -> isTablet ( ) ; self :: $ detectCode [ 'mobile' ] = $ detect -> isMobile ( ) && ! $ detect -> isTablet ( ) ; self :: $ detectCode [ 'desktop' ] = ! self :: $ detectCode [ 'tablet' ] && ! self :: $ detectCode [ 'mobile' ] ; self :: $ detectCode [ 'device' ] = 'desktop' ; foreach ( $ detect -> getRules ( ) as $ name => $ regex ) { if ( $ detect -> { 'is' . $ name } ( ) ) { self :: $ detectCode [ 'device' ] = $ name ; break ; } } }
docstring: Permet l'identification de la plate-forme
docstring_tokens: Permet l identification de la plate - forme