@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $this->dom->addChild( |
141 | 141 | $ideVinculo, |
142 | 142 | "codCateg", |
143 | - ! empty($this->std->idevinculo->codcateg) ? $this->std->idevinculo->codcateg : null, |
|
143 | + !empty($this->std->idevinculo->codcateg) ? $this->std->idevinculo->codcateg : null, |
|
144 | 144 | false |
145 | 145 | ); |
146 | 146 | $this->node->appendChild($ideVinculo); |
@@ -166,21 +166,21 @@ discard block |
||
166 | 166 | $this->dom->addChild( |
167 | 167 | $iniAfastamento, |
168 | 168 | "infoMesmoMtv", |
169 | - ! empty($this->std->iniafastamento->infomesmomtv) ? $this->std->iniafastamento->infomesmomtv : null, |
|
169 | + !empty($this->std->iniafastamento->infomesmomtv) ? $this->std->iniafastamento->infomesmomtv : null, |
|
170 | 170 | false |
171 | 171 | ); |
172 | 172 | |
173 | 173 | $this->dom->addChild( |
174 | 174 | $iniAfastamento, |
175 | 175 | "tpAcidTransito", |
176 | - ! empty($this->std->iniafastamento->tpacidtransito) ? $this->std->iniafastamento->tpacidtransito : null, |
|
176 | + !empty($this->std->iniafastamento->tpacidtransito) ? $this->std->iniafastamento->tpacidtransito : null, |
|
177 | 177 | false |
178 | 178 | ); |
179 | 179 | |
180 | 180 | $this->dom->addChild( |
181 | 181 | $iniAfastamento, |
182 | 182 | "observacao", |
183 | - ! empty($this->std->iniafastamento->observacao) ? $this->std->iniafastamento->observacao : null, |
|
183 | + !empty($this->std->iniafastamento->observacao) ? $this->std->iniafastamento->observacao : null, |
|
184 | 184 | false |
185 | 185 | ); |
186 | 186 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $this->dom->addChild( |
192 | 192 | $infoAtestado, |
193 | 193 | "codCID", |
194 | - ! empty($info->codcid) ? $info->codcid : null, |
|
194 | + !empty($info->codcid) ? $info->codcid : null, |
|
195 | 195 | false |
196 | 196 | ); |
197 | 197 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $this->dom->addChild( |
230 | 230 | $emitente, |
231 | 231 | "ufOC", |
232 | - ! empty($info->emitente->ufoc) ? $info->emitente->ufoc : null, |
|
232 | + !empty($info->emitente->ufoc) ? $info->emitente->ufoc : null, |
|
233 | 233 | false |
234 | 234 | ); |
235 | 235 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | - if (! empty($this->std->infocessao)) { |
|
243 | + if (!empty($this->std->infocessao)) { |
|
244 | 244 | $infoCessao = $this->dom->createElement("infoCessao"); |
245 | 245 | |
246 | 246 | $this->dom->addChild( |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $iniAfastamento->appendChild($infoCessao); |
261 | 261 | } |
262 | 262 | |
263 | - if (! empty($this->std->infomandsind)) { |
|
263 | + if (!empty($this->std->infomandsind)) { |
|
264 | 264 | $infoMandSind = $this->dom->createElement("infoMandSind"); |
265 | 265 | |
266 | 266 | $this->dom->addChild( |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | $infoAfastamento->appendChild($iniAfastamento); |
284 | 284 | |
285 | - if (! empty($this->std->inforetif)) { |
|
285 | + if (!empty($this->std->inforetif)) { |
|
286 | 286 | $infoRetif = $this->dom->createElement("infoRetif"); |
287 | 287 | |
288 | 288 | $this->dom->addChild( |
@@ -302,14 +302,14 @@ discard block |
||
302 | 302 | $this->dom->addChild( |
303 | 303 | $infoRetif, |
304 | 304 | "nrProc", |
305 | - ! empty($this->std->inforetif->nrproc) ? $this->std->inforetif->nrproc : null, |
|
305 | + !empty($this->std->inforetif->nrproc) ? $this->std->inforetif->nrproc : null, |
|
306 | 306 | false |
307 | 307 | ); |
308 | 308 | |
309 | 309 | $infoAfastamento->appendChild($infoRetif); |
310 | 310 | } |
311 | 311 | |
312 | - if (! empty($this->std->fimafastamento)) { |
|
312 | + if (!empty($this->std->fimafastamento)) { |
|
313 | 313 | $fimAfastamento = $this->dom->createElement("fimAfastamento"); |
314 | 314 | $this->dom->addChild( |
315 | 315 | $fimAfastamento, |
@@ -172,7 +172,7 @@ |
||
172 | 172 | /** |
173 | 173 | * Stringfy layout number |
174 | 174 | * @param string $version |
175 | - * @param int $lenght |
|
175 | + * @param int $length |
|
176 | 176 | * @return string |
177 | 177 | */ |
178 | 178 | protected function stringfyVersions($version, $length = 2) |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @var array |
87 | 87 | */ |
88 | 88 | protected $grupos = [ |
89 | - 1 => [ //EVENTOS INICIAIS grupo [1] |
|
89 | + 1 => [//EVENTOS INICIAIS grupo [1] |
|
90 | 90 | 'S-1000', |
91 | 91 | 'S-1005', |
92 | 92 | 'S-1010', |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'S-1080', |
101 | 101 | 'S-2100', |
102 | 102 | ], |
103 | - 2 => [ //EVENTOS NÃO PERIÓDICOS grupo [2] |
|
103 | + 2 => [//EVENTOS NÃO PERIÓDICOS grupo [2] |
|
104 | 104 | 'S-2190', |
105 | 105 | 'S-2200', |
106 | 106 | 'S-2205', |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'S-5011', |
125 | 125 | 'S-5012', |
126 | 126 | ], |
127 | - 3 => [ //EVENTOS PERIÓDICOS grupo [3] |
|
127 | + 3 => [//EVENTOS PERIÓDICOS grupo [3] |
|
128 | 128 | 'S-1200', |
129 | 129 | 'S-1202', |
130 | 130 | 'S-1207', |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $this->certificate = $certificate; |
166 | 166 | $this->path = realpath(__DIR__ . '/../../') . '/'; |
167 | 167 | $this->serviceXsd = XsdSeeker::seek( |
168 | - $this->path."schemes/comunicacao/$this->serviceStr/" |
|
168 | + $this->path . "schemes/comunicacao/$this->serviceStr/" |
|
169 | 169 | ); |
170 | 170 | } |
171 | 171 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | * @param string $action |
81 | 81 | * @param string $envelope |
82 | 82 | * @param array $parameters |
83 | - */ |
|
83 | + */ |
|
84 | 84 | public function send( |
85 | 85 | $operation, |
86 | 86 | $url, |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | //set properties from config |
121 | 121 | $stdConf = json_decode($config); |
122 | 122 | $this->date = new DateTime(); |
123 | - if (! empty($date)) { |
|
123 | + if (!empty($date)) { |
|
124 | 124 | $this->date = new DateTime($date); |
125 | 125 | } |
126 | 126 | $this->tpAmb = $stdConf->tpAmb; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $this->nmRazao = $stdConf->empregador->nmRazao; |
132 | 132 | $this->layoutStr = $this->strLayoutVer($this->layout); |
133 | 133 | $this->certificate = $certificate; |
134 | - if (empty($std) || ! is_object($std)) { |
|
134 | + if (empty($std) || !is_object($std)) { |
|
135 | 135 | throw new \InvalidArgumentException( |
136 | 136 | 'Você deve passar os parâmetros num stdClass.' |
137 | 137 | ); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | .$this->evtName |
143 | 143 | .".schema" |
144 | 144 | ); |
145 | - $this->schema = realpath( |
|
145 | + $this->schema = realpath( |
|
146 | 146 | __DIR__ |
147 | 147 | ."/../../schemes/$this->layoutStr/" |
148 | 148 | .$this->evtName |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $fils = explode('.', $layout); |
170 | 170 | $str = 'v'; |
171 | 171 | foreach ($fils as $fil) { |
172 | - $str .= str_pad($fil, 2, '0', STR_PAD_LEFT).'_'; |
|
172 | + $str .= str_pad($fil, 2, '0', STR_PAD_LEFT) . '_'; |
|
173 | 173 | } |
174 | 174 | return substr($str, 0, -1); |
175 | 175 | } |
@@ -201,12 +201,12 @@ discard block |
||
201 | 201 | */ |
202 | 202 | protected function validInputData($data) |
203 | 203 | { |
204 | - if (! is_file($this->jsonschema)) { |
|
204 | + if (!is_file($this->jsonschema)) { |
|
205 | 205 | return true; |
206 | 206 | } |
207 | 207 | $validator = new JsonValid(); |
208 | - $validator->check($data, (object) ['$ref' => 'file://'.$this->jsonschema]); |
|
209 | - if (! $validator->isValid()) { |
|
208 | + $validator->check($data, (object) ['$ref' => 'file://' . $this->jsonschema]); |
|
209 | + if (!$validator->isValid()) { |
|
210 | 210 | $msg = "JSON does not validate. Violations:\n"; |
211 | 211 | foreach ($validator->getErrors() as $error) { |
212 | 212 | $msg .= sprintf("[%s] %s\n", $error['property'], $error['message']); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function standardizeProperties(stdClass $data) |
365 | 365 | { |
366 | - if (! is_file($this->jsonschema)) { |
|
366 | + if (!is_file($this->jsonschema)) { |
|
367 | 367 | return $data; |
368 | 368 | } |
369 | 369 | $jsonSchemaObj = json_decode(file_get_contents($this->jsonschema)); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | { |
379 | 379 | $xml = $this->dom->saveXML($this->eSocial); |
380 | 380 | $xml = Strings::clearXmlString($xml); |
381 | - if (! empty($this->certificate)) { |
|
381 | + if (!empty($this->certificate)) { |
|
382 | 382 | $xml = Signer::sign( |
383 | 383 | $this->certificate, |
384 | 384 | $xml, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | public static function prettyPrint($response, $save = '') |
14 | 14 | { |
15 | 15 | $std = json_decode($response); |
16 | - if (! empty($save)) { |
|
16 | + if (!empty($save)) { |
|
17 | 17 | file_put_contents( |
18 | 18 | "$save.xml", |
19 | 19 | $std->body |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $html .= $std->header; |
47 | 47 | $html .= "<br>"; |
48 | 48 | $html .= '<h2>namespaces</h2>'; |
49 | - $an = json_decode(json_encode($std->namespaces), true); |
|
49 | + $an = json_decode(json_encode($std->namespaces), true); |
|
50 | 50 | foreach ($an as $key => $nam) { |
51 | 51 | $html .= "[$key] => $nam <br>"; |
52 | 52 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function toStd($xml = null) |
62 | 62 | { |
63 | - if (! empty($xml)) { |
|
63 | + if (!empty($xml)) { |
|
64 | 64 | $this->whichIs($xml); |
65 | 65 | } |
66 | 66 | $sxml = simplexml_load_string($this->node); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function whichIs($xml) |
83 | 83 | { |
84 | - if (! Validator::isXML($xml)) { |
|
84 | + if (!Validator::isXML($xml)) { |
|
85 | 85 | throw new InvalidArgumentException( |
86 | 86 | "O argumento passado não é um XML válido." |
87 | 87 | ); |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | $dom->formatOutput = false; |
92 | 92 | $dom->loadXML($xml); |
93 | 93 | foreach ($this->rootTagList as $key) { |
94 | - $node = ! empty($dom->getElementsByTagName($key)->item(0)) |
|
94 | + $node = !empty($dom->getElementsByTagName($key)->item(0)) |
|
95 | 95 | ? $dom->getElementsByTagName($key)->item(0) |
96 | 96 | : ''; |
97 | - if (! empty($node)) { |
|
97 | + if (!empty($node)) { |
|
98 | 98 | $this->node = $dom->saveXML($node); |
99 | 99 | return $key; |
100 | 100 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function toJson($xml = null) |
122 | 122 | { |
123 | - if (! empty($xml)) { |
|
123 | + if (!empty($xml)) { |
|
124 | 124 | $this->toStd($xml); |
125 | 125 | } |
126 | 126 | return $this->json; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function toYaml($xml = null) |
135 | 135 | { |
136 | - if (! empty($xml)) { |
|
136 | + if (!empty($xml)) { |
|
137 | 137 | $this->toStd($xml); |
138 | 138 | } |
139 | 139 | $array = $this->toArray(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function toArray($xml = null) |
149 | 149 | { |
150 | - if (! empty($xml)) { |
|
150 | + if (!empty($xml)) { |
|
151 | 151 | $this->toStd($xml); |
152 | 152 | } |
153 | 153 | return json_decode($this->json, true); |
@@ -194,7 +194,7 @@ |
||
194 | 194 | } |
195 | 195 | foreach ($eventos as $evt) { |
196 | 196 | //verifica se o evento pertence ao grupo indicado |
197 | - if (! in_array($evt->alias(), $this->grupos[$grupo])) { |
|
197 | + if (!in_array($evt->alias(), $this->grupos[$grupo])) { |
|
198 | 198 | throw new RuntimeException( |
199 | 199 | 'O evento ' . $evt->alias() . ' não pertence a este grupo [ ' |
200 | 200 | . $this->eventGroup[$grupo] . ' ].' |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $ref = ''; |
109 | 109 | } |
110 | 110 | if ($prop->type == 'object') { |
111 | - if (! empty($ref)) { |
|
111 | + if (!empty($ref)) { |
|
112 | 112 | $ref .= ":$name"; |
113 | 113 | } else { |
114 | 114 | $ref = $name; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } else { |
118 | 118 | $comm = "\$clone->"; |
119 | 119 | $orig = "\$data->"; |
120 | - if (! empty($ref)) { |
|
120 | + if (!empty($ref)) { |
|
121 | 121 | $part = explode(':', $ref); |
122 | 122 | $num = count($part); |
123 | 123 | foreach ($part as $p) { |
@@ -125,15 +125,15 @@ discard block |
||
125 | 125 | $orig .= "$p->"; |
126 | 126 | } |
127 | 127 | $exist = false; |
128 | - $test = "\$exist = (!empty(".substr($orig, 0, strlen($orig) - 2).")) ? true : false;"; |
|
128 | + $test = "\$exist = (!empty(" . substr($orig, 0, strlen($orig) - 2) . ")) ? true : false;"; |
|
129 | 129 | eval($test); |
130 | 130 | } |
131 | 131 | $orig .= $name; |
132 | 132 | $resp = null; |
133 | 133 | eval("\$resp = $orig;"); |
134 | 134 | |
135 | - if (! empty($resp) || $resp === 0) { |
|
136 | - $comm .= $name.'= $resp'; |
|
135 | + if (!empty($resp) || $resp === 0) { |
|
136 | + $comm .= $name . '= $resp'; |
|
137 | 137 | } else { |
138 | 138 | $comm .= "$name = null"; |
139 | 139 | } |
@@ -17,7 +17,6 @@ |
||
17 | 17 | |
18 | 18 | use NFePHP\Common\Certificate; |
19 | 19 | use NFePHP\eSocial\Common\Factory; |
20 | -use NFePHP\eSocial\Common\FactoryId; |
|
21 | 20 | use NFePHP\eSocial\Common\FactoryInterface; |
22 | 21 | use stdClass; |
23 | 22 |