@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function render() |
| 59 | 59 | { |
| 60 | 60 | $this->tcpdf->addPage(); |
| 61 | - $x = 5; |
|
| 61 | + $x = 5; |
|
| 62 | 62 | $y = 10; |
| 63 | 63 | |
| 64 | 64 | $width = $this->tcpdf->getPageWidth() - ($x * 2); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $this->tcpdf->SetFontSize(9); |
| 94 | 94 | |
| 95 | 95 | $this->tcpdf->SetXY($x, $y + 10); |
| 96 | - return [$this->tcpdf->GetX(),$this->tcpdf->GetY()]; |
|
| 96 | + return [$this->tcpdf->GetX(), $this->tcpdf->GetY()]; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $i = 0; |
| 234 | 234 | foreach ($tags as $tag) { |
| 235 | 235 | /** @var PostalObject $tag */ |
| 236 | - $this->tcpdf->SetFillColor($fill[$i%2]); |
|
| 236 | + $this->tcpdf->SetFillColor($fill[$i % 2]); |
|
| 237 | 237 | $name = $this->postalServices->{$tag->getService()}->name; |
| 238 | 238 | $this->tcpdf->SetXY($x, $y); |
| 239 | 239 | $this->tcpdf->Cell($parts * 10, $h, $tag->getTagDv(), 0, 0, '', true); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $this->tcpdf->Cell($parts * 10, $h, $tag->getValueDeclared(), 0, 0, '', true); |
| 247 | 247 | $this->tcpdf->Cell($parts * 10, $h, $tag->getInvoiceNumber(), 0, 0, '', true); |
| 248 | 248 | $this->tcpdf->Cell($parts * 6, $h, '1/1', 0, 0, '', true); |
| 249 | - $this->tcpdf->Cell(($parts * 24) -1.5, $h, $tag->getRecipient()->getName(), 0, 0, '', true); |
|
| 249 | + $this->tcpdf->Cell(($parts * 24) - 1.5, $h, $tag->getRecipient()->getName(), 0, 0, '', true); |
|
| 250 | 250 | $y += $h; |
| 251 | 251 | $i++; |
| 252 | 252 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | private function filterTags(array $tags) |
| 113 | 113 | { |
| 114 | - return array_filter($tags, function ($tag) { |
|
| 114 | + return array_filter($tags, function($tag) { |
|
| 115 | 115 | /** @var PostalObject $tag */ |
| 116 | 116 | return in_array('001', $tag->getAdditionalServices()); |
| 117 | 117 | }); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $y += 10; |
| 209 | 209 | $this->tcpdf->SetXY($x, $y); |
| 210 | 210 | $this->tcpdf->Line($xDefault, $y, $this->tcpdf->getPageWidth() - 2.5, $y); |
| 211 | - return [$this->tcpdf->GetX(),$this->tcpdf->GetY()]; |
|
| 211 | + return [$this->tcpdf->GetX(), $this->tcpdf->GetY()]; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | private function retry($x, $y) |
| 373 | 373 | { |
| 374 | 374 | $x += 95; |
| 375 | - $xDefault = $x; |
|
| 375 | + $xDefault = $x; |
|
| 376 | 376 | $this->tcpdf->Rect($x, $y, 65, $this->getNoticeReceiptHeight() - 22, 'DF', [], [255, 255, 255]); |
| 377 | 377 | |
| 378 | 378 | $x += 2; |
@@ -463,8 +463,8 @@ discard block |
||
| 463 | 463 | $this->tcpdf->SetFontSize(6); |
| 464 | 464 | $allSize = $this->getNoticeReceiptHeight() - 10; |
| 465 | 465 | |
| 466 | - $first = ($allSize/10)*6; |
|
| 467 | - $last = ($allSize/10)*4; |
|
| 466 | + $first = ($allSize / 10) * 6; |
|
| 467 | + $last = ($allSize / 10) * 4; |
|
| 468 | 468 | |
| 469 | 469 | $this->tcpdf->SetXY($x + 4, $y + $this->padding); |
| 470 | 470 | $this->tcpdf->Rect($x, $y, 38, $first, 'DF', [], [255, 255, 255]); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $this->additionalServices = json_decode(file_get_contents(CORREIOS_PHP_BASE . '/storage/additional_services.json')); |
| 75 | 75 | $this->postalServices = json_decode(file_get_contents(CORREIOS_PHP_BASE . '/storage/postal_service.json')); |
| 76 | 76 | $this->setPrintable($printable); |
| 77 | - $size = [215.9, 279.4]; |
|
| 77 | + $size = [215.9, 279.4]; |
|
| 78 | 78 | |
| 79 | 79 | if ($this->getModel() == PrintableContract::MODEL_SINGLE) { |
| 80 | 80 | $size = $this->getTagSize(); |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | 'border' => 0, |
| 241 | 241 | 'vpadding' => 1, |
| 242 | 242 | 'hpadding' => 1, |
| 243 | - 'fgcolor' => array(0,0,0), |
|
| 244 | - 'bgcolor' => array(255,255,255), |
|
| 243 | + 'fgcolor' => array(0, 0, 0), |
|
| 244 | + 'bgcolor' => array(255, 255, 255), |
|
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | 247 | $validRecipientCep = str_split(preg_replace('/[^0-9]/', '', $tag->getRecipient()->getCep()), 1); |
@@ -322,12 +322,12 @@ discard block |
||
| 322 | 322 | $yDefault = $y; |
| 323 | 323 | // Contract and Service data |
| 324 | 324 | $y += 6; |
| 325 | - $this->tcpdf->SetXY($x-1, $y); |
|
| 325 | + $this->tcpdf->SetXY($x - 1, $y); |
|
| 326 | 326 | $this->tcpdf->Write(3, 'Contrato: '); |
| 327 | 327 | $this->writeBold(3, $this->getConfig()->getContract()); |
| 328 | 328 | |
| 329 | 329 | $y += 3; |
| 330 | - $this->tcpdf->SetXY($x-1, $y); |
|
| 330 | + $this->tcpdf->SetXY($x - 1, $y); |
|
| 331 | 331 | $name = $this->postalServices->{$tag->getService()}->name; |
| 332 | 332 | $this->writeBold(3, $name); |
| 333 | 333 | |
@@ -424,8 +424,8 @@ discard block |
||
| 424 | 424 | 'border' => 0, |
| 425 | 425 | 'hpadding' => 0, |
| 426 | 426 | 'vpadding' => 0, |
| 427 | - 'fgcolor' => array(0,0,0), |
|
| 428 | - 'bgcolor' => array(255,255,255), |
|
| 427 | + 'fgcolor' => array(0, 0, 0), |
|
| 428 | + 'bgcolor' => array(255, 255, 255), |
|
| 429 | 429 | 'text' => false, |
| 430 | 430 | ); |
| 431 | 431 | |
@@ -493,8 +493,8 @@ discard block |
||
| 493 | 493 | 'border' => 0, |
| 494 | 494 | 'hpadding' => 0, |
| 495 | 495 | 'vpadding' => 0, |
| 496 | - 'fgcolor' => array(0,0,0), |
|
| 497 | - 'bgcolor' => array(255,255,255), |
|
| 496 | + 'fgcolor' => array(0, 0, 0), |
|
| 497 | + 'bgcolor' => array(255, 255, 255), |
|
| 498 | 498 | 'text' => false, |
| 499 | 499 | ); |
| 500 | 500 | |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $yAdd = -1; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | - $this->tcpdf->Rect($xDefault - 1, $y, 40, $hTitle, 'DF', [], [0,0,0]); |
|
| 520 | + $this->tcpdf->Rect($xDefault - 1, $y, 40, $hTitle, 'DF', [], [0, 0, 0]); |
|
| 521 | 521 | $this->tcpdf->SetXY($x, $y); |
| 522 | 522 | $this->tcpdf->SetTextColor(255); |
| 523 | 523 | $this->writeBold($hTitle, 'DESTINATÁRIO'); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $this->tcpdf->SetFontSize(9); |
| 131 | 131 | |
| 132 | 132 | $this->tcpdf->SetXY($x, $y + 10); |
| 133 | - return [$this->tcpdf->GetX(),$this->tcpdf->GetY()]; |
|
| 133 | + return [$this->tcpdf->GetX(), $this->tcpdf->GetY()]; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | |
| 303 | 303 | $y += 3; |
| 304 | 304 | $this->tcpdf->SetLineStyle(['dash' => '4,2']); |
| 305 | - $this->tcpdf->Line($x, $y, $x+$width, $y, []); |
|
| 305 | + $this->tcpdf->Line($x, $y, $x + $width, $y, []); |
|
| 306 | 306 | $this->tcpdf->SetLineStyle(['dash' => 0]); |
| 307 | 307 | $y += 5; |
| 308 | 308 | |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | const SERVICE_SEDEX_10 = '40215'; |
| 15 | 15 | const SERVICE_SEDEX_HOJE = '40290'; |
| 16 | 16 | |
| 17 | - const FORMAT_PACOTE = 1; |
|
| 18 | - const FORMAT_ROLO = 1; |
|
| 19 | - const FORMAT_ENVELOPE = 3; |
|
| 17 | + const FORMAT_PACOTE = 1; |
|
| 18 | + const FORMAT_ROLO = 1; |
|
| 19 | + const FORMAT_ENVELOPE = 3; |
|
| 20 | 20 | |
| 21 | 21 | public function __construct(ConfigContract $config = null, $type = 'curl') |
| 22 | 22 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | $envelope .= ">"; |
| 135 | 135 | $envelope .= "<soap:Body>$request</soap:Body>"; |
| 136 | - $envelope .= "</soap:Envelope>"; |
|
| 136 | + $envelope .= "</soap:Envelope>"; |
|
| 137 | 137 | return $envelope; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $response = $dom->getElementsByTagName('Body') |
| 159 | 159 | ->item(0) // Get Body |
| 160 | 160 | ->childNodes->item(0); // Get Result Object; |
| 161 | - $response = simplexml_load_string($dom->saveXML($response)); |
|
| 161 | + $response = simplexml_load_string($dom->saveXML($response)); |
|
| 162 | 162 | $response = json_encode($response, JSON_PRETTY_PRINT); |
| 163 | 163 | return json_decode($response); |
| 164 | 164 | } |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | if ($this->proxyIP != '') { |
| 21 | 21 | curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); |
| 22 | 22 | curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); |
| 23 | - curl_setopt($curl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort); |
|
| 23 | + curl_setopt($curl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort); |
|
| 24 | 24 | if ($this->proxyUser != '') { |
| 25 | - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass); |
|
| 25 | + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass); |
|
| 26 | 26 | curl_setopt($curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | ->childNodes->item(0); // Get Result Object; |
| 60 | 60 | $response = $dom->saveXML($response); |
| 61 | 61 | $response = preg_replace('/\<(\/?)\w+:(\w+\/?)\>/', '<$1$2>', $response); |
| 62 | - $response = simplexml_load_string($response); |
|
| 62 | + $response = simplexml_load_string($response); |
|
| 63 | 63 | $response = json_encode($response, JSON_PRETTY_PRINT); |
| 64 | 64 | return json_decode($response); |
| 65 | 65 | } |
@@ -537,7 +537,7 @@ |
||
| 537 | 537 | $matches += ['prefix' => null, 'sufix' => '']; |
| 538 | 538 | $chars = str_split($matches['number'], 1); |
| 539 | 539 | $sums = str_split("86423597", 1); |
| 540 | - $rest = array_reduce($chars, function (&$sum, $a) use (&$sums) { |
|
| 540 | + $rest = array_reduce($chars, function(&$sum, $a) use (&$sums) { |
|
| 541 | 541 | return $sum += $a * array_shift($sums); |
| 542 | 542 | }) % 11; |
| 543 | 543 | $dv = 5; |