| @@ -23,10 +23,10 @@ discard block | ||
| 23 | 23 | public static function replaceSpecialsChars($string) | 
| 24 | 24 |      { | 
| 25 | 25 | $string = trim($string); | 
| 26 | - $aFind = ['&','á','à','ã','â','é','ê','í','ó','ô','õ','ú','ü', | |
| 27 | - 'ç','Á','À','Ã','Â','É','Ê','Í','Ó','Ô','Õ','Ú','Ü','Ç']; | |
| 28 | - $aSubs = ['e','a','a','a','a','e','e','i','o','o','o','u','u', | |
| 29 | - 'c','A','A','A','A','E','E','I','O','O','O','U','U','C']; | |
| 26 | + $aFind = ['&', 'á', 'à', 'ã', 'â', 'é', 'ê', 'í', 'ó', 'ô', 'õ', 'ú', 'ü', | |
| 27 | + 'ç', 'Á', 'À', 'Ã', 'Â', 'É', 'Ê', 'Í', 'Ó', 'Ô', 'Õ', 'Ú', 'Ü', 'Ç']; | |
| 28 | + $aSubs = ['e', 'a', 'a', 'a', 'a', 'e', 'e', 'i', 'o', 'o', 'o', 'u', 'u', | |
| 29 | + 'c', 'A', 'A', 'A', 'A', 'E', 'E', 'I', 'O', 'O', 'O', 'U', 'U', 'C']; | |
| 30 | 30 | $newstr = str_replace($aFind, $aSubs, $string); | 
| 31 | 31 |          $newstr = preg_replace("/[^a-zA-Z0-9 @,-.;:\/]/", "", $newstr); | 
| 32 | 32 | return $newstr; | 
| @@ -94,11 +94,11 @@ discard block | ||
| 94 | 94 | public static function clearProtocoledXML($string) | 
| 95 | 95 |      { | 
| 96 | 96 | $procXML = self::clearXmlString($string); | 
| 97 | -        $aApp = array('nfe','cte','mdfe'); | |
| 97 | +        $aApp = array('nfe', 'cte', 'mdfe'); | |
| 98 | 98 |          foreach ($aApp as $app) { | 
| 99 | 99 | $procXML = str_replace( | 
| 100 | - 'xmlns="http://www.portalfiscal.inf.br/'.$app.'" xmlns="http://www.w3.org/2000/09/xmldsig#"', | |
| 101 | - 'xmlns="http://www.portalfiscal.inf.br/'.$app.'"', | |
| 100 | + 'xmlns="http://www.portalfiscal.inf.br/' . $app . '" xmlns="http://www.w3.org/2000/09/xmldsig#"', | |
| 101 | + 'xmlns="http://www.portalfiscal.inf.br/' . $app . '"', | |
| 102 | 102 | $procXML | 
| 103 | 103 | ); | 
| 104 | 104 | } | 
| @@ -113,11 +113,11 @@ discard block | ||
| 113 | 113 | public static function removeSomeAlienCharsfromTxt($txt) | 
| 114 | 114 |      { | 
| 115 | 115 | //remove CRs and TABs | 
| 116 | - $txt = str_replace(["\r","\t"], "", $txt); | |
| 116 | + $txt = str_replace(["\r", "\t"], "", $txt); | |
| 117 | 117 | //remove multiple spaces | 
| 118 | 118 |          $txt = preg_replace('/(?:\s\s+)/', ' ', $txt); | 
| 119 | 119 | //remove spaces at begin and end of fields | 
| 120 | - $txt = str_replace(["| "," |"], "|", $txt); | |
| 120 | + $txt = str_replace(["| ", " |"], "|", $txt); | |
| 121 | 121 | return $txt; | 
| 122 | 122 | } | 
| 123 | 123 | |