示例#1
0
 /**
  * @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);
 }
示例#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);
 }