@@ -248,7 +248,7 @@ |
||
248 | 248 | |
249 | 249 | /** |
250 | 250 | * Return uid from user |
251 | - * @return string |
|
251 | + * @return integer |
|
252 | 252 | */ |
253 | 253 | protected function uid() |
254 | 254 | { |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | . $this->uid() |
274 | 274 | .'/' |
275 | 275 | . $mapto |
276 | - . '/' ; |
|
277 | - $folderRealPath = sys_get_temp_dir().$path; |
|
276 | + . '/'; |
|
277 | + $folderRealPath = sys_get_temp_dir() . $path; |
|
278 | 278 | } |
279 | 279 | if (substr($folderRealPath, -1) !== '/') { |
280 | 280 | $folderRealPath .= '/'; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | if (!$this->filesystem->has($name)) { |
564 | 564 | return $name; |
565 | 565 | } |
566 | - $this->randomName($n+5); |
|
566 | + $this->randomName($n + 5); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | /** |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | //remove todos os arquivos antigos |
584 | 584 | $contents = $this->filesystem->listContents($this->certsdir, true); |
585 | 585 | $dt = new \DateTime(); |
586 | - $tint = new \DateInterval("PT".$this->waitingTime."M"); |
|
586 | + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); |
|
587 | 587 | $tint->invert = 1; |
588 | 588 | $tsLimit = $dt->add($tint)->getTimestamp(); |
589 | 589 | foreach ($contents as $item) { |
@@ -194,8 +194,8 @@ |
||
194 | 194 | $mdec = strpos($n[1], '-'); |
195 | 195 | $p = explode('.', $value); |
196 | 196 | |
197 | - $ndec = !empty($p[1]) ? strlen($p[1]) : 0;//decimal digits |
|
198 | - $nint = strlen($p[0]);//integer digits |
|
197 | + $ndec = !empty($p[1]) ? strlen($p[1]) : 0; //decimal digits |
|
198 | + $nint = strlen($p[0]); //integer digits |
|
199 | 199 | if ($nint > $n[0]) { |
200 | 200 | throw new \InvalidArgumentException("O numero é maior que o permitido [$format]."); |
201 | 201 | } |
@@ -10,6 +10,6 @@ |
||
10 | 10 | public function __construct(Certificate $certificate) |
11 | 11 | { |
12 | 12 | $invalidDate = $certificate->getValidTo()->format('Y-m-d H:i:s'); |
13 | - parent::__construct('Certificate era válido até '.$invalidDate, 0, null); |
|
13 | + parent::__construct('Certificate era válido até ' . $invalidDate, 0, null); |
|
14 | 14 | } |
15 | 15 | } |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | //& isolated, less than, greater than, quotation marks and apostrophes |
83 | 83 | //should be replaced by their html equivalent |
84 | 84 | $input = str_replace( |
85 | - ['& ','<','>','"',"'"], |
|
86 | - ['&','<','>','"','''], |
|
85 | + ['& ', '<', '>', '"', "'"], |
|
86 | + ['&', '<', '>', '"', '''], |
|
87 | 87 | $input |
88 | 88 | ); |
89 | 89 | $input = self::normalize($input); |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | public static function squashCharacters($input) |
111 | 111 | { |
112 | 112 | $input = trim($input); |
113 | - $aFind = ['á','à','ã','â','é','ê','í','ó','ô','õ','ö','ú','ü', |
|
114 | - 'ç','Á','À','Ã','Â','É','Ê','Í','Ó','Ô','Õ','Ö','Ú','Ü','Ç']; |
|
115 | - $aSubs = ['a','a','a','a','e','e','i','o','o','o','o','u','u', |
|
116 | - 'c','A','A','A','A','E','E','I','O','O','O','O','U','U','C']; |
|
113 | + $aFind = ['á', 'à', 'ã', 'â', 'é', 'ê', 'í', 'ó', 'ô', 'õ', 'ö', 'ú', 'ü', |
|
114 | + 'ç', 'Á', 'À', 'Ã', 'Â', 'É', 'Ê', 'Í', 'Ó', 'Ô', 'Õ', 'Ö', 'Ú', 'Ü', 'Ç']; |
|
115 | + $aSubs = ['a', 'a', 'a', 'a', 'e', 'e', 'i', 'o', 'o', 'o', 'o', 'u', 'u', |
|
116 | + 'c', 'A', 'A', 'A', 'A', 'E', 'E', 'I', 'O', 'O', 'O', 'O', 'U', 'U', 'C']; |
|
117 | 117 | return str_replace($aFind, $aSubs, $input); |
118 | 118 | } |
119 | 119 | |
@@ -127,21 +127,21 @@ discard block |
||
127 | 127 | public static function normalize($input) |
128 | 128 | { |
129 | 129 | //Carriage Return, Tab and Line Feed is not acceptable in strings |
130 | - $input = str_replace(["\r","\t","\n"], "", $input); |
|
130 | + $input = str_replace(["\r", "\t", "\n"], "", $input); |
|
131 | 131 | //Multiple spaces is not acceptable in strings |
132 | 132 | $input = preg_replace('/(?:\s\s+)/', ' ', $input); |
133 | 133 | //Only UTF-8 characters is acceptable |
134 | 134 | $input = Encoding::fixUTF8($input); |
135 | 135 | $input = preg_replace( |
136 | - '/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'. |
|
137 | - '|[\x00-\x7F][\x80-\xBF]+'. |
|
138 | - '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'. |
|
139 | - '|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'. |
|
136 | + '/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]' . |
|
137 | + '|[\x00-\x7F][\x80-\xBF]+' . |
|
138 | + '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*' . |
|
139 | + '|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})' . |
|
140 | 140 | '|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S', |
141 | 141 | '', |
142 | 142 | $input |
143 | 143 | ); |
144 | - $input = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]'. |
|
144 | + $input = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]' . |
|
145 | 145 | '|\xED[\xA0-\xBF][\x80-\xBF]/S', '', $input); |
146 | 146 | //And no other control character is acceptable either |
147 | 147 | return preg_replace('/[[:cntrl:]]/', '', $input); |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | public static function clearProtocoledXML($string) |
210 | 210 | { |
211 | 211 | $procXML = self::clearXmlString($string); |
212 | - $aApp = array('nfe','cte','mdfe'); |
|
212 | + $aApp = array('nfe', 'cte', 'mdfe'); |
|
213 | 213 | foreach ($aApp as $app) { |
214 | 214 | $procXML = str_replace( |
215 | - 'xmlns="http://www.portalfiscal.inf.br/'.$app.'" xmlns="http://www.w3.org/2000/09/xmldsig#"', |
|
216 | - 'xmlns="http://www.portalfiscal.inf.br/'.$app.'"', |
|
215 | + 'xmlns="http://www.portalfiscal.inf.br/' . $app . '" xmlns="http://www.w3.org/2000/09/xmldsig#"', |
|
216 | + 'xmlns="http://www.portalfiscal.inf.br/' . $app . '"', |
|
217 | 217 | $procXML |
218 | 218 | ); |
219 | 219 | } |
@@ -228,11 +228,11 @@ discard block |
||
228 | 228 | public static function removeSomeAlienCharsfromTxt($txt) |
229 | 229 | { |
230 | 230 | //remove CRs and TABs |
231 | - $txt = str_replace(["\r","\t"], "", $txt); |
|
231 | + $txt = str_replace(["\r", "\t"], "", $txt); |
|
232 | 232 | //remove multiple spaces |
233 | 233 | $txt = preg_replace('/(?:\s\s+)/', ' ', $txt); |
234 | 234 | //remove spaces at begin and end of fields |
235 | - $txt = str_replace(["| "," |"], "|", $txt); |
|
235 | + $txt = str_replace(["| ", " |"], "|", $txt); |
|
236 | 236 | return $txt; |
237 | 237 | } |
238 | 238 |