/** * @depends testProcessFile */ public function testGetFileParser(File $file) { $parser = ParseManager::getParser($file); $this->assertInstanceOf(\Engine\IO\File\Parser\Contract::class, $parser); $this->assertInstanceOf(\Engine\IO\File\Parser\Csv::class, $parser); }
public function getContent(Parser $parser = null) { if (is_null($parser)) { if (is_null($this->content)) { $parser = ParseManager::getParser($this); } else { return $this->content; } } if (is_null($this->rawContent)) { $this->rawContent = file_get_contents($this->path); } $this->content = $parser->parse($this->rawContent); return $this->content; }