public function parse(File $template) { $template->setReadFunction('fgets'); $matches = array(); foreach ($template as $number => $line) { $match = $this->parseLine($line, $number); if (!$match) { $this->log->log($line); continue; } $matches[] = $match; } return $matches; }