diff --git a/src/RemFactory.php b/src/RemFactory.php index e18577b..bb2cd55 100644 --- a/src/RemFactory.php +++ b/src/RemFactory.php @@ -17,7 +17,8 @@ public function __construct($savePath = null) public function build(Header $header, array $transacoes) { - $file = fopen($this->savePath . '/' . (new File())->buildName(), 'w'); + $fileName = (new File())->buildName(); + $file = fopen($this->savePath . '/' . $fileName, 'w'); $stringHeader = $header->getIdentificacaoRegistro() . $header->getIdentificacaoArquivo() @@ -105,6 +106,6 @@ public function build(Header $header, array $transacoes) fclose($file); - return $this->savePath; + return $this->savePath . '/' . $fileName; } }