original_string: public function findTaxonomy($taxonomies, $operator = 'and')
      {
          $matches = [];
          $results = [];
  
          foreach ((array)$taxonomies as $taxonomy => $items) {
              foreach ((array)$items as $item) {
                  if (isset($this->taxonomy_map[$taxonomy][$item])) {
                      $matches[] = $this->taxonomy_map[$taxonomy][$item];
                  } else {
                      $matches[] = [];
                  }
              }
          }
  
          if (strtolower($operator) === 'or') {
              foreach ($matches as $match) {
                  $results = array_merge($results, $match);
              }
          } else {
              $results = $matches ? array_pop($matches) : [];
              foreach ($matches as $match) {
                  $results = array_intersect_key($results, $match);
              }
          }
  
          return new Collection($results, ['taxonomies' => $taxonomies]);
      }
code: public function findTaxonomy($taxonomies, $operator = 'and')
      {
          $matches = [];
          $results = [];
  
          foreach ((array)$taxonomies as $taxonomy => $items) {
              foreach ((array)$items as $item) {
                  if (isset($this->taxonomy_map[$taxonomy][$item])) {
                      $matches[] = $this->taxonomy_map[$taxonomy][$item];
                  } else {
                      $matches[] = [];
                  }
              }
          }
  
          if (strtolower($operator) === 'or') {
              foreach ($matches as $match) {
                  $results = array_merge($results, $match);
              }
          } else {
              $results = $matches ? array_pop($matches) : [];
              foreach ($matches as $match) {
                  $results = array_intersect_key($results, $match);
              }
          }
  
          return new Collection($results, ['taxonomies' => $taxonomies]);
      }
code_tokens: public function findTaxonomy ( $ taxonomies , $ operator = 'and' ) { $ matches = [ ] ; $ results = [ ] ; foreach ( ( array ) $ taxonomies as $ taxonomy => $ items ) { foreach ( ( array ) $ items as $ item ) { if ( isset ( $ this -> taxonomy_map [ $ taxonomy ] [ $ item ] ) ) { $ matches [ ] = $ this -> taxonomy_map [ $ taxonomy ] [ $ item ] ; } else { $ matches [ ] = [ ] ; } } } if ( strtolower ( $ operator ) === 'or' ) { foreach ( $ matches as $ match ) { $ results = array_merge ( $ results , $ match ) ; } } else { $ results = $ matches ? array_pop ( $ matches ) : [ ] ; foreach ( $ matches as $ match ) { $ results = array_intersect_key ( $ results , $ match ) ; } } return new Collection ( $ results , [ 'taxonomies' => $ taxonomies ] ) ; }
docstring: Returns a new Page object with the sub-pages containing all the values set for a
  particular taxonomy.
  
  @param  array  $taxonomies taxonomies to search, eg ['tag'=>['animal','cat']]
  @param  string $operator   can be 'or' or 'and' (defaults to 'and')
  
  @return Collection       Collection object set to contain matches found in the taxonomy map
docstring_tokens: Returns a new Page object with the sub - pages containing all the values set for a particular taxonomy .