@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $this->dom->addChild( |
| 114 | 114 | $ideRubrica, |
| 115 | 115 | "fimValid", |
| 116 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
| 116 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
| 117 | 117 | false |
| 118 | 118 | ); |
| 119 | 119 | //seleção do modo |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | $node->appendChild($ideRubrica); |
| 128 | 128 | |
| 129 | - if (! empty($this->std->dadosrubrica)) { |
|
| 129 | + if (!empty($this->std->dadosrubrica)) { |
|
| 130 | 130 | $dadosRubrica = $this->dom->createElement("dadosRubrica"); |
| 131 | 131 | $this->dom->addChild( |
| 132 | 132 | $dadosRubrica, |
@@ -197,13 +197,13 @@ discard block |
||
| 197 | 197 | $this->dom->addChild( |
| 198 | 198 | $dadosRubrica, |
| 199 | 199 | "observacao", |
| 200 | - ! empty($this->std->dadosrubrica->observacao) |
|
| 200 | + !empty($this->std->dadosrubrica->observacao) |
|
| 201 | 201 | ? $this->std->dadosrubrica->observacao |
| 202 | 202 | : null, |
| 203 | 203 | false |
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | - if (! empty($this->std->dadosrubrica->ideprocessocp)) { |
|
| 206 | + if (!empty($this->std->dadosrubrica->ideprocessocp)) { |
|
| 207 | 207 | foreach ($this->std->dadosrubrica->ideprocessocp as $cp) { |
| 208 | 208 | $ideProcessoCP = $this->dom->createElement("ideProcessoCP"); |
| 209 | 209 | $this->dom->addChild( |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - if (! empty($this->std->dadosrubrica->ideprocessoirrf)) { |
|
| 237 | + if (!empty($this->std->dadosrubrica->ideprocessoirrf)) { |
|
| 238 | 238 | foreach ($this->std->dadosrubrica->ideprocessoirrf as $irrf) { |
| 239 | 239 | $ideProcessoIRRF = $this->dom->createElement("ideProcessoIRRF"); |
| 240 | 240 | $this->dom->addChild( |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $dadosRubrica->appendChild($ideProcessoIRRF); |
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | - if (! empty($this->std->dadosrubrica->ideprocessofgts)) { |
|
| 255 | + if (!empty($this->std->dadosrubrica->ideprocessofgts)) { |
|
| 256 | 256 | foreach ($this->std->dadosrubrica->ideprocessofgts as $fgts) { |
| 257 | 257 | $ideProcessoFGTS = $this->dom->createElement("ideProcessoFGTS"); |
| 258 | 258 | $this->dom->addChild( |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $dadosRubrica->appendChild($ideProcessoFGTS); |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | - if (! empty($this->std->dadosrubrica->ideprocessosind)) { |
|
| 273 | + if (!empty($this->std->dadosrubrica->ideprocessosind)) { |
|
| 274 | 274 | foreach ($this->std->dadosrubrica->ideprocessosind as $sind) { |
| 275 | 275 | $ideProcessoSIND = $this->dom->createElement("ideProcessoSIND"); |
| 276 | 276 | $this->dom->addChild( |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | $node->appendChild($dadosRubrica); |
| 292 | 292 | } |
| 293 | - if (! empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
| 293 | + if (!empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
| 294 | 294 | $newVal = $this->std->novavalidade; |
| 295 | 295 | $novaValidade = $this->dom->createElement("novaValidade"); |
| 296 | 296 | $this->dom->addChild( |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $this->dom->addChild( |
| 303 | 303 | $ideRubrica, |
| 304 | 304 | "fimValid", |
| 305 | - ! empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
| 305 | + !empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
| 306 | 306 | false |
| 307 | 307 | ); |
| 308 | 308 | $node->appendChild($novaValidade); |
@@ -188,10 +188,10 @@ |
||
| 188 | 188 | } |
| 189 | 189 | foreach ($eventos as $evt) { |
| 190 | 190 | //verifica se o evento pertence ao grupo indicado |
| 191 | - if (! in_array($evt->alias(), $this->grupos[$grupo])) { |
|
| 191 | + if (!in_array($evt->alias(), $this->grupos[$grupo])) { |
|
| 192 | 192 | throw new RuntimeException( |
| 193 | - 'O evento '.$evt->alias().' não pertence a este grupo [ ' |
|
| 194 | - .$this->eventGroup[$grupo].' ].' |
|
| 193 | + 'O evento ' . $evt->alias() . ' não pertence a este grupo [ ' |
|
| 194 | + .$this->eventGroup[$grupo] . ' ].' |
|
| 195 | 195 | ); |
| 196 | 196 | } |
| 197 | 197 | $this->checkCertificate($evt); |
@@ -137,13 +137,13 @@ |
||
| 137 | 137 | $name = str_replace('-', '', strtolower($name)); |
| 138 | 138 | $realname = $name; |
| 139 | 139 | if (substr($name, 0, 1) == 's') { |
| 140 | - if (! array_key_exists($name, self::$aliases)) { |
|
| 140 | + if (!array_key_exists($name, self::$aliases)) { |
|
| 141 | 141 | //este evento não foi localizado |
| 142 | 142 | throw EventsException::wrongArgument(1000, $name); |
| 143 | 143 | } |
| 144 | 144 | $realname = self::$aliases[$name]; |
| 145 | 145 | } |
| 146 | - if (! array_key_exists($realname, self::$available)) { |
|
| 146 | + if (!array_key_exists($realname, self::$available)) { |
|
| 147 | 147 | //este evento não foi localizado |
| 148 | 148 | throw EventsException::wrongArgument(1000, $name); |
| 149 | 149 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | protected function getProperties( |
| 94 | 94 | \stdClass $schema, |
| 95 | 95 | \stdClass $data, |
| 96 | - \stdClass &$clone, |
|
| 96 | + \stdClass & $clone, |
|
| 97 | 97 | $keys, |
| 98 | 98 | $ref = '' |
| 99 | 99 | ) { |
@@ -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 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function toStd($xml = null) |
| 57 | 57 | { |
| 58 | - if (! empty($xml)) { |
|
| 58 | + if (!empty($xml)) { |
|
| 59 | 59 | $this->whichIs($xml); |
| 60 | 60 | } |
| 61 | 61 | $sxml = simplexml_load_string($this->node); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function whichIs($xml) |
| 80 | 80 | { |
| 81 | - if (! Validator::isXML($xml)) { |
|
| 81 | + if (!Validator::isXML($xml)) { |
|
| 82 | 82 | throw new InvalidArgumentException( |
| 83 | 83 | "O argumento passado não é um XML válido." |
| 84 | 84 | ); |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | $dom->formatOutput = false; |
| 89 | 89 | $dom->loadXML($xml); |
| 90 | 90 | foreach ($this->rootTagList as $key) { |
| 91 | - $node = ! empty($dom->getElementsByTagName($key)->item(0)) |
|
| 91 | + $node = !empty($dom->getElementsByTagName($key)->item(0)) |
|
| 92 | 92 | ? $dom->getElementsByTagName($key)->item(0) |
| 93 | 93 | : ''; |
| 94 | - if (! empty($node)) { |
|
| 94 | + if (!empty($node)) { |
|
| 95 | 95 | $this->node = $dom->saveXML($node); |
| 96 | 96 | |
| 97 | 97 | return $key; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function toJson($xml = null) |
| 123 | 123 | { |
| 124 | - if (! empty($xml)) { |
|
| 124 | + if (!empty($xml)) { |
|
| 125 | 125 | $this->toStd($xml); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function toYaml($xml = null) |
| 139 | 139 | { |
| 140 | - if (! empty($xml)) { |
|
| 140 | + if (!empty($xml)) { |
|
| 141 | 141 | $this->toStd($xml); |
| 142 | 142 | } |
| 143 | 143 | $array = $this->toArray(); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function toArray($xml = null) |
| 156 | 156 | { |
| 157 | - if (! empty($xml)) { |
|
| 157 | + if (!empty($xml)) { |
|
| 158 | 158 | $this->toStd($xml); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | //set properties from config |
| 148 | 148 | $stdConf = json_decode($config); |
| 149 | 149 | $this->date = new DateTime(); |
| 150 | - if (! empty($date)) { |
|
| 150 | + if (!empty($date)) { |
|
| 151 | 151 | $this->date = new DateTime($date); |
| 152 | 152 | } |
| 153 | 153 | $this->tpAmb = $stdConf->tpAmb; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $this->nmRazao = $stdConf->empregador->nmRazao; |
| 159 | 159 | $this->layoutStr = $this->strLayoutVer($this->layout); |
| 160 | 160 | $this->certificate = $certificate; |
| 161 | - if (empty($std) || ! is_object($std)) { |
|
| 161 | + if (empty($std) || !is_object($std)) { |
|
| 162 | 162 | throw new \InvalidArgumentException( |
| 163 | 163 | 'Você deve passar os parâmetros num stdClass.' |
| 164 | 164 | ); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | .$this->evtName |
| 170 | 170 | .".schema" |
| 171 | 171 | ); |
| 172 | - $this->schema = realpath( |
|
| 172 | + $this->schema = realpath( |
|
| 173 | 173 | __DIR__ |
| 174 | 174 | ."/../../schemes/$this->layoutStr/" |
| 175 | 175 | .$this->evtName |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $fils = explode('.', $layout); |
| 199 | 199 | $str = 'v'; |
| 200 | 200 | foreach ($fils as $fil) { |
| 201 | - $str .= str_pad($fil, 2, '0', STR_PAD_LEFT).'_'; |
|
| 201 | + $str .= str_pad($fil, 2, '0', STR_PAD_LEFT) . '_'; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | return substr($str, 0, -1); |
@@ -236,12 +236,12 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | protected function validInputData($data) |
| 238 | 238 | { |
| 239 | - if (! is_file($this->jsonschema)) { |
|
| 239 | + if (!is_file($this->jsonschema)) { |
|
| 240 | 240 | return true; |
| 241 | 241 | } |
| 242 | 242 | $validator = new JsonValid(); |
| 243 | - $validator->check($data, (object) ['$ref' => 'file://'.$this->jsonschema]); |
|
| 244 | - if (! $validator->isValid()) { |
|
| 243 | + $validator->check($data, (object) ['$ref' => 'file://' . $this->jsonschema]); |
|
| 244 | + if (!$validator->isValid()) { |
|
| 245 | 245 | $msg = "JSON does not validate. Violations:\n"; |
| 246 | 246 | foreach ($validator->getErrors() as $error) { |
| 247 | 247 | $msg .= sprintf("[%s] %s\n", $error['property'], $error['message']); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | public function standardizeProperties(stdClass $data) |
| 400 | 400 | { |
| 401 | - if (! is_file($this->jsonschema)) { |
|
| 401 | + if (!is_file($this->jsonschema)) { |
|
| 402 | 402 | return $data; |
| 403 | 403 | } |
| 404 | 404 | $jsonSchemaObj = json_decode(file_get_contents($this->jsonschema)); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | { |
| 415 | 415 | $xml = $this->dom->saveXML($this->eSocial); |
| 416 | 416 | $xml = Strings::clearXmlString($xml); |
| 417 | - if (! empty($this->certificate)) { |
|
| 417 | + if (!empty($this->certificate)) { |
|
| 418 | 418 | $xml = Signer::sign( |
| 419 | 419 | $this->certificate, |
| 420 | 420 | $xml, |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | public static function prettyPrint($response, $save = '') |
| 8 | 8 | { |
| 9 | 9 | $std = json_decode($response); |
| 10 | - if (! empty($save)) { |
|
| 10 | + if (!empty($save)) { |
|
| 11 | 11 | file_put_contents( |
| 12 | 12 | "/var/www/sped/sped-nfe/tests/fixtures/xml/$save.xml", |
| 13 | 13 | $std->body |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $html .= $std->header; |
| 43 | 43 | $html .= "<br>"; |
| 44 | 44 | $html .= '<h2>namespaces</h2>'; |
| 45 | - $an = json_decode(json_encode($std->namespaces), true); |
|
| 45 | + $an = json_decode(json_encode($std->namespaces), true); |
|
| 46 | 46 | foreach ($an as $key => $nam) { |
| 47 | 47 | $html .= "[$key] => $nam <br>"; |
| 48 | 48 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |