for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LoteriaApi\Consumer;
use \DOMDocument;
use LoteriaApi\Consumer\Reader\LoteriaNumbersNode;
class Reader
{
private $datasource;
private $paths;
public function setDataSource($datasource)
$this->datasource = $datasource;
return $this;
}
public function setPathsStorage($paths)
$this->paths = $paths;
public function getData()
$data = [];
foreach ($this->datasource as $concursoName => $concursoData) {
$file = $this->paths['path']['ext'].$concursoData['html'];
$doc = new DOMDocument();
$doc->loadHTMLFile($file);
$data[$concursoName] = (new $concursoData['reader'])
->setDOMDocument($doc)
->setNumbersNode(new LoteriaNumbersNode)
->getData();
return $data;