From 28aecbb5434781420582454079997a5f74a4fecd Mon Sep 17 00:00:00 2001 From: Giancarlos Salas Date: Thu, 15 Apr 2021 21:08:44 -0500 Subject: [PATCH] Remove spaces --- src/Peru/Sunat/RucParser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Peru/Sunat/RucParser.php b/src/Peru/Sunat/RucParser.php index 07d6850..61da1f9 100644 --- a/src/Peru/Sunat/RucParser.php +++ b/src/Peru/Sunat/RucParser.php @@ -114,7 +114,7 @@ private function getFirstLine(string $text): string { $lines = explode("\r\n", $text); - return $lines[0]; + return trim($lines[0]); } private function fixEstado(Company $company): void @@ -124,11 +124,11 @@ private function fixEstado(Company $company): void if ($count === 1) { return; } - $company->estado = $lines[0]; $validLines = iterator_to_array($this->filterValidLines($lines)); $updateFechaBaja = count($validLines) === 3 && $company->fechaBaja === null; + $company->estado = $validLines[0]; $company->fechaBaja = $updateFechaBaja ? $this->parseDate($validLines[2]): $company->fechaBaja; }