@@ -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 | ); |
@@ -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, |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $this->dom->addChild( |
| 70 | 70 | $ideEvento, |
| 71 | 71 | "nrRecArqBase", |
| 72 | - ! empty($this->std->nrrecarqbase) ? $this->std->nrrecarqbase : null, |
|
| 72 | + !empty($this->std->nrrecarqbase) ? $this->std->nrrecarqbase : null, |
|
| 73 | 73 | false |
| 74 | 74 | ); |
| 75 | 75 | $this->dom->addChild( |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | true |
| 88 | 88 | ); |
| 89 | 89 | $this->node->appendChild($ideTrabalhador); |
| 90 | - if (! empty($this->std->vrdeddep)) { |
|
| 90 | + if (!empty($this->std->vrdeddep)) { |
|
| 91 | 91 | $infoDep = $this->dom->createElement("infoDep"); |
| 92 | 92 | $this->dom->addChild( |
| 93 | 93 | $infoDep, |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $this->dom->addChild( |
| 103 | 103 | $infoIrrf, |
| 104 | 104 | "codCateg", |
| 105 | - ! empty($nIrrf->codcateg) ? $nIrrf->codcateg : null, |
|
| 105 | + !empty($nIrrf->codcateg) ? $nIrrf->codcateg : null, |
|
| 106 | 106 | false |
| 107 | 107 | ); |
| 108 | 108 | $this->dom->addChild( |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $this->dom->addChild( |
| 162 | 162 | $idePais, |
| 163 | 163 | "nifBenef", |
| 164 | - ! empty($nIrrf->idepgtoext->nifbenef) ? $nIrrf->idepgtoext->nifbenef : null, |
|
| 164 | + !empty($nIrrf->idepgtoext->nifbenef) ? $nIrrf->idepgtoext->nifbenef : null, |
|
| 165 | 165 | false |
| 166 | 166 | ); |
| 167 | 167 | $idePgtoExt->appendChild($idePais); |
@@ -176,19 +176,19 @@ discard block |
||
| 176 | 176 | $this->dom->addChild( |
| 177 | 177 | $endExt, |
| 178 | 178 | "nrLograd", |
| 179 | - ! empty($nIrrf->idepgtoext->nrlograd) ? $nIrrf->idepgtoext->nrlograd : null, |
|
| 179 | + !empty($nIrrf->idepgtoext->nrlograd) ? $nIrrf->idepgtoext->nrlograd : null, |
|
| 180 | 180 | false |
| 181 | 181 | ); |
| 182 | 182 | $this->dom->addChild( |
| 183 | 183 | $endExt, |
| 184 | 184 | "complem", |
| 185 | - ! empty($nIrrf->idepgtoext->complem) ? $nIrrf->idepgtoext->complem : null, |
|
| 185 | + !empty($nIrrf->idepgtoext->complem) ? $nIrrf->idepgtoext->complem : null, |
|
| 186 | 186 | false |
| 187 | 187 | ); |
| 188 | 188 | $this->dom->addChild( |
| 189 | 189 | $endExt, |
| 190 | 190 | "bairro", |
| 191 | - ! empty($nIrrf->idepgtoext->bairro) ? $nIrrf->idepgtoext->bairro : null, |
|
| 191 | + !empty($nIrrf->idepgtoext->bairro) ? $nIrrf->idepgtoext->bairro : null, |
|
| 192 | 192 | false |
| 193 | 193 | ); |
| 194 | 194 | $this->dom->addChild( |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $this->dom->addChild( |
| 201 | 201 | $endExt, |
| 202 | 202 | "codPostal", |
| 203 | - ! empty($nIrrf->idepgtoext->codpostal) ? $nIrrf->idepgtoext->codpostal : null, |
|
| 203 | + !empty($nIrrf->idepgtoext->codpostal) ? $nIrrf->idepgtoext->codpostal : null, |
|
| 204 | 204 | false |
| 205 | 205 | ); |
| 206 | 206 | $idePgtoExt->appendChild($endExt); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $this->dom->addChild( |
| 122 | 122 | $ideRespInf, |
| 123 | 123 | "email", |
| 124 | - ! empty($this->std->iderespinf->email) ? $this->std->iderespinf->email : null, |
|
| 124 | + !empty($this->std->iderespinf->email) ? $this->std->iderespinf->email : null, |
|
| 125 | 125 | false |
| 126 | 126 | ); |
| 127 | 127 | $this->node->appendChild($ideRespInf); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $this->dom->addChild( |
| 167 | 167 | $infoFech, |
| 168 | 168 | "compSemMovto", |
| 169 | - ! empty($this->std->infofech->compsemmovto) ? $this->std->infofech->compsemmovto : null, |
|
| 169 | + !empty($this->std->infofech->compsemmovto) ? $this->std->infofech->compsemmovto : null, |
|
| 170 | 170 | false |
| 171 | 171 | ); |
| 172 | 172 | $this->node->appendChild($infoFech); |
@@ -235,8 +235,7 @@ |
||
| 235 | 235 | $this->dom->addChild( |
| 236 | 236 | $instEnsino, |
| 237 | 237 | "bairro", |
| 238 | - !empty($this->std->estagiario->instituicao->bairro) ? $this->std->estagiario->instituicao->bairro : |
|
| 239 | - null, |
|
| 238 | + !empty($this->std->estagiario->instituicao->bairro) ? $this->std->estagiario->instituicao->bairro : null, |
|
| 240 | 239 | false |
| 241 | 240 | ); |
| 242 | 241 | $this->dom->addChild( |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $this->dom->addChild( |
| 116 | 116 | $ide, |
| 117 | 117 | "fimValid", |
| 118 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
| 118 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
| 119 | 119 | false |
| 120 | 120 | ); |
| 121 | 121 | //seleção do modo |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $this->dom->addChild( |
| 133 | 133 | $dados, |
| 134 | 134 | "indAutoria", |
| 135 | - ! empty($this->std->dadosproc->indautoria) |
|
| 135 | + !empty($this->std->dadosproc->indautoria) |
|
| 136 | 136 | ? $this->std->dadosproc->indautoria |
| 137 | 137 | : null, |
| 138 | 138 | false |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | !empty($this->std->dadosproc->observacao) ? $this->std->dadosproc->observacao : null, |
| 150 | 150 | false |
| 151 | 151 | ); |
| 152 | - if (! empty($this->std->dadosproc->dadosprocjud)) { |
|
| 152 | + if (!empty($this->std->dadosproc->dadosprocjud)) { |
|
| 153 | 153 | $dadosProcJud = $this->dom->createElement("dadosProcJud"); |
| 154 | 154 | $this->dom->addChild( |
| 155 | 155 | $dadosProcJud, |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | ); |
| 172 | 172 | $dados->appendChild($dadosProcJud); |
| 173 | 173 | } |
| 174 | - if (! empty($this->std->dadosproc->infosusp)) { |
|
| 174 | + if (!empty($this->std->dadosproc->infosusp)) { |
|
| 175 | 175 | foreach ($this->std->dadosproc->infosusp as $susp) { |
| 176 | 176 | $infoSusp = $this->dom->createElement("infoSusp"); |
| 177 | 177 | $this->dom->addChild( |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | $node->appendChild($dados); |
| 205 | 205 | |
| 206 | - if (! empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
| 206 | + if (!empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
| 207 | 207 | $newVal = $this->std->novavalidade; |
| 208 | 208 | $novaValidade = $this->dom->createElement("novaValidade"); |
| 209 | 209 | $this->dom->addChild( |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $this->dom->addChild( |
| 216 | 216 | $ideRubrica, |
| 217 | 217 | "fimValid", |
| 218 | - ! empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
| 218 | + !empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
| 219 | 219 | false |
| 220 | 220 | ); |
| 221 | 221 | $node->appendChild($novaValidade); |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | use NFePHP\Common\Certificate; |
| 18 | 18 | use NFePHP\eSocial\Common\Factory; |
| 19 | -use NFePHP\eSocial\Common\FactoryId; |
|
| 20 | 19 | use NFePHP\eSocial\Common\FactoryInterface; |
| 21 | 20 | use stdClass; |
| 22 | 21 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @param string $url |
| 39 | 39 | * @param string $action |
| 40 | 40 | * @param string $envelope |
| 41 | - * @param array $parameters |
|
| 41 | + * @param string[] $parameters |
|
| 42 | 42 | * @return string |
| 43 | 43 | * @throws \NFePHP\Common\Exception\SoapException |
| 44 | 44 | */ |
@@ -63,20 +63,20 @@ discard block |
||
| 63 | 63 | curl_setopt($oCurl, CURLOPT_HEADER, 1); |
| 64 | 64 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 0); |
| 65 | 65 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, 0); |
| 66 | - if (! $this->disablesec) { |
|
| 66 | + if (!$this->disablesec) { |
|
| 67 | 67 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 2); |
| 68 | 68 | if (is_file($this->casefaz)) { |
| 69 | 69 | curl_setopt($oCurl, CURLOPT_CAINFO, $this->casefaz); |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | curl_setopt($oCurl, CURLOPT_SSLVERSION, $this->soapprotocol); |
| 73 | - curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir.$this->certfile); |
|
| 74 | - curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir.$this->prifile); |
|
| 75 | - if (! empty($this->temppass)) { |
|
| 73 | + curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir . $this->certfile); |
|
| 74 | + curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir . $this->prifile); |
|
| 75 | + if (!empty($this->temppass)) { |
|
| 76 | 76 | curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass); |
| 77 | 77 | } |
| 78 | 78 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); |
| 79 | - if (! empty($envelope)) { |
|
| 79 | + if (!empty($envelope)) { |
|
| 80 | 80 | curl_setopt($oCurl, CURLOPT_POST, true); |
| 81 | 81 | curl_setopt($oCurl, CURLOPT_POSTFIELDS, $envelope); |
| 82 | 82 | curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parameters); |
@@ -94,14 +94,14 @@ discard block |
||
| 94 | 94 | $this->responseBody = trim(substr($response, $headsize)); |
| 95 | 95 | $this->saveDebugFiles( |
| 96 | 96 | $operation, |
| 97 | - $this->requestHead."\n".$this->requestBody, |
|
| 98 | - $this->responseHead."\n".$this->responseBody |
|
| 97 | + $this->requestHead . "\n" . $this->requestBody, |
|
| 98 | + $this->responseHead . "\n" . $this->responseBody |
|
| 99 | 99 | ); |
| 100 | 100 | } catch (\Exception $e) { |
| 101 | 101 | throw SoapException::unableToLoadCurl($e->getMessage()); |
| 102 | 102 | } |
| 103 | 103 | if ($this->soaperror != '') { |
| 104 | - throw SoapException::soapFault($this->soaperror." [$url]"); |
|
| 104 | + throw SoapException::soapFault($this->soaperror . " [$url]"); |
|
| 105 | 105 | } |
| 106 | 106 | if ($httpcode != 200) { |
| 107 | 107 | throw SoapException::soapFault( |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | if ($this->proxyIP != '') { |
| 122 | 122 | curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1); |
| 123 | 123 | curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); |
| 124 | - curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort); |
|
| 124 | + curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort); |
|
| 125 | 125 | if ($this->proxyUser != '') { |
| 126 | - curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass); |
|
| 126 | + curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass); |
|
| 127 | 127 | curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $dom->preserveWhiteSpace = false; |
| 145 | 145 | $dom->loadXML($body); |
| 146 | 146 | $faultstring = ''; |
| 147 | - $nodefault = ! empty($dom->getElementsByTagName('faultstring')->item(0)) |
|
| 147 | + $nodefault = !empty($dom->getElementsByTagName('faultstring')->item(0)) |
|
| 148 | 148 | ? $dom->getElementsByTagName('faultstring')->item(0) |
| 149 | 149 | : ''; |
| 150 | 150 | if (!empty($nodefault)) { |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 0); |
| 172 | 172 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, 0); |
| 173 | 173 | curl_setopt($oCurl, CURLOPT_SSLVERSION, $this->soapprotocol); |
| 174 | - curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir.$this->certfile); |
|
| 175 | - curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir.$this->prifile); |
|
| 176 | - if (! empty($this->temppass)) { |
|
| 174 | + curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir . $this->certfile); |
|
| 175 | + curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir . $this->prifile); |
|
| 176 | + if (!empty($this->temppass)) { |
|
| 177 | 177 | curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass); |
| 178 | 178 | } |
| 179 | 179 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); |
@@ -171,7 +171,7 @@ |
||
| 171 | 171 | $this->dom->addChild( |
| 172 | 172 | $nova, |
| 173 | 173 | "fimValid", |
| 174 | - ! empty($this->std->novavalidade->fimvalid) |
|
| 174 | + !empty($this->std->novavalidade->fimvalid) |
|
| 175 | 175 | ? $this->std->novavalidade->fimvalid |
| 176 | 176 | : null, |
| 177 | 177 | false |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->dom->addChild( |
| 107 | 107 | $ide, |
| 108 | 108 | "fimValid", |
| 109 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
| 109 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
| 110 | 110 | false |
| 111 | 111 | ); |
| 112 | 112 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $this->dom->addChild( |
| 182 | 182 | $nova, |
| 183 | 183 | "fimValid", |
| 184 | - ! empty($this->std->novavalidade->fimvalid) |
|
| 184 | + !empty($this->std->novavalidade->fimvalid) |
|
| 185 | 185 | ? $this->std->novavalidade->fimvalid |
| 186 | 186 | : null, |
| 187 | 187 | false |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | } elseif ($this->std->modo == 'ALT') { |
| 198 | 198 | $node = $this->dom->createElement("alteracao"); |
| 199 | 199 | $node->appendChild($ide); |
| 200 | - isset($dados) ? $node->appendChild($dados): null; |
|
| 201 | - isset($nova) ? $node->appendChild($nova): null; |
|
| 200 | + isset($dados) ? $node->appendChild($dados) : null; |
|
| 201 | + isset($nova) ? $node->appendChild($nova) : null; |
|
| 202 | 202 | } else { |
| 203 | 203 | $node = $this->dom->createElement("exclusao"); |
| 204 | 204 | $node->appendChild($ide); |