original_string: public function process_analysable(\core_analytics\analysable $analysable): array {
  
          // Target instances scope is per-analysable (it can't be lower as calculations run once per
          // analysable, not time splitting method nor time range).
          $target = call_user_func(array($this->analyser->get_target(), 'instance'));
  
          // We need to check that the analysable is valid for the target even if we don't include targets
          // as we still need to discard invalid analysables for the target.
          $isvalidresult = $target->is_valid_analysable($analysable, $this->includetarget);
          if ($isvalidresult !== true) {
              $a = new \stdClass();
              $a->analysableid = $analysable->get_name();
              $a->result = $isvalidresult;
              $this->analyser->add_log(get_string('analysablenotvalidfortarget', 'analytics', $a));
              return array();
          }
  
          // Process all provided time splitting methods.
          $results = array();
          foreach ($this->analyser->get_timesplittings() as $timesplitting) {
  
              $cachedresult = $this->result->retrieve_cached_result($timesplitting, $analysable);
              if ($cachedresult) {
                  $result = new \stdClass();
                  $result->result = $cachedresult;
                  $results[$timesplitting->get_id()] = $result;
                  continue;
              }
  
              $results[$timesplitting->get_id()] = $this->process_time_splitting($timesplitting, $analysable, $target);
          }
  
          return $results;
      }
code: public function process_analysable(\core_analytics\analysable $analysable): array {
  
          // Target instances scope is per-analysable (it can't be lower as calculations run once per
          // analysable, not time splitting method nor time range).
          $target = call_user_func(array($this->analyser->get_target(), 'instance'));
  
          // We need to check that the analysable is valid for the target even if we don't include targets
          // as we still need to discard invalid analysables for the target.
          $isvalidresult = $target->is_valid_analysable($analysable, $this->includetarget);
          if ($isvalidresult !== true) {
              $a = new \stdClass();
              $a->analysableid = $analysable->get_name();
              $a->result = $isvalidresult;
              $this->analyser->add_log(get_string('analysablenotvalidfortarget', 'analytics', $a));
              return array();
          }
  
          // Process all provided time splitting methods.
          $results = array();
          foreach ($this->analyser->get_timesplittings() as $timesplitting) {
  
              $cachedresult = $this->result->retrieve_cached_result($timesplitting, $analysable);
              if ($cachedresult) {
                  $result = new \stdClass();
                  $result->result = $cachedresult;
                  $results[$timesplitting->get_id()] = $result;
                  continue;
              }
  
              $results[$timesplitting->get_id()] = $this->process_time_splitting($timesplitting, $analysable, $target);
          }
  
          return $results;
      }
code_tokens: public function process_analysable ( \ core_analytics \ analysable $ analysable ) : array { // Target instances scope is per-analysable (it can't be lower as calculations run once per // analysable, not time splitting method nor time range). $ target = call_user_func ( array ( $ this -> analyser -> get_target ( ) , 'instance' ) ) ; // We need to check that the analysable is valid for the target even if we don't include targets // as we still need to discard invalid analysables for the target. $ isvalidresult = $ target -> is_valid_analysable ( $ analysable , $ this -> includetarget ) ; if ( $ isvalidresult !== true ) { $ a = new \ stdClass ( ) ; $ a -> analysableid = $ analysable -> get_name ( ) ; $ a -> result = $ isvalidresult ; $ this -> analyser -> add_log ( get_string ( 'analysablenotvalidfortarget' , 'analytics' , $ a ) ) ; return array ( ) ; } // Process all provided time splitting methods. $ results = array ( ) ; foreach ( $ this -> analyser -> get_timesplittings ( ) as $ timesplitting ) { $ cachedresult = $ this -> result -> retrieve_cached_result ( $ timesplitting , $ analysable ) ; if ( $ cachedresult ) { $ result = new \ stdClass ( ) ; $ result -> result = $ cachedresult ; $ results [ $ timesplitting -> get_id ( ) ] = $ result ; continue ; } $ results [ $ timesplitting -> get_id ( ) ] = $ this -> process_time_splitting ( $ timesplitting , $ analysable , $ target ) ; } return $ results ; }
docstring: Processes an analysable
  
  This method returns the general analysable status, an array of files by time splitting method and
  an error message if there is any problem.
  
  @param \core_analytics\analysable $analysable
  @return \stdClass[] Results objects by time splitting method
docstring_tokens: Processes an analysable