Example #1
0
 /**
  * @param string $start
  * @param string $end
  * @return $this
  */
 public function setDelimiters($start, $end)
 {
     $startQuery = new Query();
     $startQuery->valueIs($start);
     $this->setStartQuery($startQuery);
     $endQuery = new Query();
     $endQuery->valueIs($end);
     $this->setEndQuery($endQuery);
     return $this;
 }
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);
 }