/**
  * @param Collection $collection
  * @return Collection
  */
 protected function findTokens(Collection $collection)
 {
     $query = new Query();
     $query->valueLike('!\\n[ ]+\\n!');
     $query->typeIs(T_WHITESPACE);
     return $collection->find($query);
 }
Example #2
0
 /**
  * @param \Funivan\PhpTokenizer\Collection $collection
  * @return \Funivan\PhpTokenizer\Collection
  */
 protected function findTags(Collection $collection)
 {
     $query = new Query();
     $query->typeIs(T_OPEN_TAG);
     if ($this->useShortTags()) {
         $query->valueLike('!^<\\?php\\s+!');
         // long php tag contains also spaces
     } else {
         $query->valueIs('<?');
     }
     return $collection->find($query);
 }