original_string: public function detectGoalsMatchingUrl($idSite, $action)
      {
          if (!Common::isGoalPluginEnabled()) {
              return array();
          }
  
          $goals = $this->getGoalDefinitions($idSite);
  
          $convertedGoals = array();
          foreach ($goals as $goal) {
              $convertedUrl = $this->detectGoalMatch($goal, $action);
              if (!is_null($convertedUrl)) {
                  $convertedGoals[] = array('url' => $convertedUrl) + $goal;
              }
          }
          return $convertedGoals;
      }
code: public function detectGoalsMatchingUrl($idSite, $action)
      {
          if (!Common::isGoalPluginEnabled()) {
              return array();
          }
  
          $goals = $this->getGoalDefinitions($idSite);
  
          $convertedGoals = array();
          foreach ($goals as $goal) {
              $convertedUrl = $this->detectGoalMatch($goal, $action);
              if (!is_null($convertedUrl)) {
                  $convertedGoals[] = array('url' => $convertedUrl) + $goal;
              }
          }
          return $convertedGoals;
      }
code_tokens: public function detectGoalsMatchingUrl ( $ idSite , $ action ) { if ( ! Common :: isGoalPluginEnabled ( ) ) { return array ( ) ; } $ goals = $ this -> getGoalDefinitions ( $ idSite ) ; $ convertedGoals = array ( ) ; foreach ( $ goals as $ goal ) { $ convertedUrl = $ this -> detectGoalMatch ( $ goal , $ action ) ; if ( ! is_null ( $ convertedUrl ) ) { $ convertedGoals [ ] = array ( 'url' => $ convertedUrl ) + $ goal ; } } return $ convertedGoals ; }
docstring: Look at the URL or Page Title and sees if it matches any existing Goal definition
  
  @param int $idSite
  @param Action $action
  @throws Exception
  @return array[] Goals matched
docstring_tokens: Look at the URL or Page Title and sees if it matches any existing Goal definition