original_string: protected function get_all_hits(array $response) {
          $hits = array();
          foreach ($this->places as $placeno => $place) {
              $rightchoice = $this->get_right_choice_for($placeno);
              $rightchoicekey = $this->choice($rightchoice);
              if (!array_key_exists($rightchoicekey, $response)) {
                  continue;
              }
              $choicecoords = $response[$rightchoicekey];
              $coords = explode(';', $choicecoords);
              foreach ($coords as $itemno => $coord) {
                  if (trim($coord) === '') {
                      continue;
                  }
                  $pointxy = explode(',', $coord);
                  $pointxy[0] = round($pointxy[0]);
                  $pointxy[1] = round($pointxy[1]);
                  if ($place->drop_hit($pointxy)) {
                      if (!isset($hits[$placeno])) {
                          $hits[$placeno] = array();
                      }
                      $hits[$placeno][$itemno] = $coord;
                  }
              }
          }
          // Reverse sort in order of number of hits per place (if two or more
          // hits per place then we want to make sure hits do not hit elsewhere).
          $sortcomparison = function ($a1, $a2){
              return (count($a1) - count($a2));
          };
          uasort($hits, $sortcomparison);
          return $hits;
      }
code: protected function get_all_hits(array $response) {
          $hits = array();
          foreach ($this->places as $placeno => $place) {
              $rightchoice = $this->get_right_choice_for($placeno);
              $rightchoicekey = $this->choice($rightchoice);
              if (!array_key_exists($rightchoicekey, $response)) {
                  continue;
              }
              $choicecoords = $response[$rightchoicekey];
              $coords = explode(';', $choicecoords);
              foreach ($coords as $itemno => $coord) {
                  if (trim($coord) === '') {
                      continue;
                  }
                  $pointxy = explode(',', $coord);
                  $pointxy[0] = round($pointxy[0]);
                  $pointxy[1] = round($pointxy[1]);
                  if ($place->drop_hit($pointxy)) {
                      if (!isset($hits[$placeno])) {
                          $hits[$placeno] = array();
                      }
                      $hits[$placeno][$itemno] = $coord;
                  }
              }
          }
          // Reverse sort in order of number of hits per place (if two or more
          // hits per place then we want to make sure hits do not hit elsewhere).
          $sortcomparison = function ($a1, $a2){
              return (count($a1) - count($a2));
          };
          uasort($hits, $sortcomparison);
          return $hits;
      }
code_tokens: protected function get_all_hits ( array $ response ) { $ hits = array ( ) ; foreach ( $ this -> places as $ placeno => $ place ) { $ rightchoice = $ this -> get_right_choice_for ( $ placeno ) ; $ rightchoicekey = $ this -> choice ( $ rightchoice ) ; if ( ! array_key_exists ( $ rightchoicekey , $ response ) ) { continue ; } $ choicecoords = $ response [ $ rightchoicekey ] ; $ coords = explode ( ';' , $ choicecoords ) ; foreach ( $ coords as $ itemno => $ coord ) { if ( trim ( $ coord ) === '' ) { continue ; } $ pointxy = explode ( ',' , $ coord ) ; $ pointxy [ 0 ] = round ( $ pointxy [ 0 ] ) ; $ pointxy [ 1 ] = round ( $ pointxy [ 1 ] ) ; if ( $ place -> drop_hit ( $ pointxy ) ) { if ( ! isset ( $ hits [ $ placeno ] ) ) { $ hits [ $ placeno ] = array ( ) ; } $ hits [ $ placeno ] [ $ itemno ] = $ coord ; } } } // Reverse sort in order of number of hits per place (if two or more // hits per place then we want to make sure hits do not hit elsewhere). $ sortcomparison = function ( $ a1 , $ a2 ) { return ( count ( $ a1 ) - count ( $ a2 ) ) ; } ; uasort ( $ hits , $ sortcomparison ) ; return $ hits ; }
docstring: Get's an array of all hits on drop targets. Needs further processing to find which hits
  to select in the general case that drop targets may have more than one hit and drop targets
  can overlap.
  @param array $response
  @return array all hits
docstring_tokens: Get s an array of all hits on drop targets . Needs further processing to find which hits to select in the general case that drop targets may have more than one hit and drop targets can overlap .