original_string: public function getRules($userAgent = null)
      {
          // return all rules
          if ($userAgent === null) {
              return $this->rules;
          }
          $this->setUserAgent($userAgent);
          if (isset($this->rules[$this->userAgentMatch])) {
              return $this->rules[$this->userAgentMatch];
          }
          $this->log[] = 'Rules not found for the given User-Agent';
          return array();
      }
code: public function getRules($userAgent = null)
      {
          // return all rules
          if ($userAgent === null) {
              return $this->rules;
          }
          $this->setUserAgent($userAgent);
          if (isset($this->rules[$this->userAgentMatch])) {
              return $this->rules[$this->userAgentMatch];
          }
          $this->log[] = 'Rules not found for the given User-Agent';
          return array();
      }
code_tokens: public function getRules ( $ userAgent = null ) { // return all rules if ( $ userAgent === null ) { return $ this -> rules ; } $ this -> setUserAgent ( $ userAgent ) ; if ( isset ( $ this -> rules [ $ this -> userAgentMatch ] ) ) { return $ this -> rules [ $ this -> userAgentMatch ] ; } $ this -> log [ ] = 'Rules not found for the given User-Agent' ; return array ( ) ; }
docstring: Get rules based on user agent
  
  @param  string|null $userAgent
  @return array
docstring_tokens: Get rules based on user agent