@@ -256,7 +256,7 @@ |
||
| 256 | 256 | */ |
| 257 | 257 | private function strRemoveSpecialChars(string $string): string |
| 258 | 258 | { |
| 259 | - return html_entity_decode(preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde|cedil|lig);/','$1',htmlentities($this->strNormalize($string), ENT_COMPAT, "UTF-8"))); |
|
| 259 | + return html_entity_decode(preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde|cedil|lig);/', '$1', htmlentities($this->strNormalize($string), ENT_COMPAT, "UTF-8"))); |
|
| 260 | 260 | // return $this->strNormalize(preg_replace('/[^\w\s]/', '', iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', preg_replace('/[^\pL\pN]/u', ' ', $this->strNormalize($string))))); //don't work properly with iconv glibc only with libiconv |
| 261 | 261 | |
| 262 | 262 | } |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | try { |
| 26 | 26 | $this->setQuoteWeight(); |
| 27 | 27 | $promise = $client->requestAsync('GET', 'http://201.48.198.97/calculador/CalcPrecoPrazo.aspx?' . http_build_query($this->buildRequest()))->then(function ($response) { |
| 28 | - $this->parseResult($response); |
|
| 29 | - }); |
|
| 28 | + $this->parseResult($response); |
|
| 29 | + }); |
|
| 30 | 30 | $promise->wait(); |
| 31 | 31 | } catch (RequestException $e) { |
| 32 | 32 | $this->result->status = 'ERROR'; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $client = new Client(); |
| 25 | 25 | try { |
| 26 | 26 | $this->setQuoteWeight(); |
| 27 | - $promise = $client->requestAsync('GET', 'http://201.48.198.97/calculador/CalcPrecoPrazo.aspx?' . http_build_query($this->buildRequest()))->then(function ($response) { |
|
| 27 | + $promise = $client->requestAsync('GET', 'http://201.48.198.97/calculador/CalcPrecoPrazo.aspx?' . http_build_query($this->buildRequest()))->then(function($response) { |
|
| 28 | 28 | $this->parseResult($response); |
| 29 | 29 | }); |
| 30 | 30 | $promise->wait(); |
@@ -148,8 +148,8 @@ |
||
| 148 | 148 | $xpath = new \DOMXpath($doc); |
| 149 | 149 | if ($xpath->query('//*[@id="form:j_idt123_input"]/option[2]')->item(0)) { |
| 150 | 150 | $this->payer = $xpath->query('//*[@id="form:j_idt123_input"]/option[2]') |
| 151 | - ->item(0) |
|
| 152 | - ->getAttribute('value'); |
|
| 151 | + ->item(0) |
|
| 152 | + ->getAttribute('value'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | $this->setOriginAirport(); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | 'https://mycargomanager.appslatam.com/eBusiness-web-1.0-view/private/CreateQuotation.jsf', |
| 136 | 136 | [ |
| 137 | 137 | 'headers' => $this->mainHeader |
| 138 | - ])->then(function ($response) { |
|
| 138 | + ])->then(function($response) { |
|
| 139 | 139 | if (!$this->payer && strstr($response->getBody(), 'Erro ao carregar o formulário')) { |
| 140 | 140 | $this->result->status = 'ERROR'; |
| 141 | 141 | $this->result->errors[] = 'Erro ao obter dados'; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | [ |
| 199 | 199 | 'form_params' => $parameters, |
| 200 | 200 | 'headers' => $this->mainHeader |
| 201 | - ])->then(function ($response) { |
|
| 201 | + ])->then(function($response) { |
|
| 202 | 202 | $this->originAirport = $this->stringBetween($response->getBody(), 'data-item-value="', '"'); |
| 203 | 203 | }); |
| 204 | 204 | $promise->wait(); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | [ |
| 254 | 254 | 'form_params' => $parameters, |
| 255 | 255 | 'headers' => $this->mainHeader |
| 256 | - ])->then(function ($response) { |
|
| 256 | + ])->then(function($response) { |
|
| 257 | 257 | $this->destinyAirport = $this->stringBetween($response->getBody(), 'data-item-value="', '"'); |
| 258 | 258 | }); |
| 259 | 259 | $promise->wait(); |
@@ -264,7 +264,7 @@ |
||
| 264 | 264 | |
| 265 | 265 | try { |
| 266 | 266 | $this->setQuoteWeight(); |
| 267 | - $promise = $client->callAsync('calculaFrete', $this->buildRequest())->then(function ($response) { |
|
| 267 | + $promise = $client->callAsync('calculaFrete', $this->buildRequest())->then(function($response) { |
|
| 268 | 268 | $this->parseResult($response); |
| 269 | 269 | }); |
| 270 | 270 | $promise->wait(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $factory = new Factory(); |
| 109 | 109 | $client = $factory->create(new Client(), 'https://ws.tntbrasil.com.br/tntws/Localizacao?wsdl'); |
| 110 | 110 | try { |
| 111 | - $promise = $client->callAsync('localizaMercadoria', $this->buildRequest())->then(function ($response) { |
|
| 111 | + $promise = $client->callAsync('localizaMercadoria', $this->buildRequest())->then(function($response) { |
|
| 112 | 112 | $this->parseResult($response); |
| 113 | 113 | }); |
| 114 | 114 | $promise->wait(); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | 'localizaMercadoria' => [ |
| 129 | 129 | 'in0' => [ |
| 130 | 130 | 'cnpj' => new \SoapVar($this->senderTaxId, XSD_STRING, 'string', null, 'cnpj', 'http://model.localizacao.mercurio.com'), |
| 131 | - 'nf' => $this->invoiceNumber ? new \SoapVar($this->invoiceNumber, XSD_INT, 'int', null, 'nf', 'http://model.localizacao.mercurio.com'): '?', |
|
| 131 | + 'nf' => $this->invoiceNumber ? new \SoapVar($this->invoiceNumber, XSD_INT, 'int', null, 'nf', 'http://model.localizacao.mercurio.com') : '?', |
|
| 132 | 132 | 'nfSerie' => $this->invoiceSeries ? new \SoapVar($this->invoiceSeries, XSD_STRING, 'string', null, 'nfSerie', 'http://model.localizacao.mercurio.com') : '?', |
| 133 | 133 | 'pedido' => $this->orderNumber ? new \SoapVar($this->orderNumber, XSD_INT, 'int', null, 'pedido', 'http://model.localizacao.mercurio.com') : '?', |
| 134 | 134 | 'usuario' => new \SoapVar($this->login, XSD_STRING, 'string', null, 'usuario', 'http://model.localizacao.mercurio.com'), |