Skip to content

Commit

Permalink
Fix incopatibility with php7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cagartner committed Aug 6, 2020
1 parent 0ea9158 commit 2b817dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Carriers/Correios.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function calculate()
array_push($rates, $shippingRate);

} catch (\Exception $exception) {

dd($exception);
}
}

Expand Down
13 changes: 2 additions & 11 deletions src/Config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'fields' => [
[
'name' => 'title',
'title' => 'Title',
'title' => 'Título',
'type' => 'text',
'validation' => 'required',
'channel_based' => false,
Expand Down Expand Up @@ -148,16 +148,7 @@
[
'name' => 'active',
'title' => 'Status',
'type' => 'select',
'options' => [
[
'title' => 'Active',
'value' => true
], [
'title' => 'Inactive',
'value' => false
]
],
'type' => 'boolean',
'validation' => 'required'
], [
'name' => 'default_method',
Expand Down
5 changes: 3 additions & 2 deletions src/Helpers/Consult.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function carriers($data, $options = array())
'valor_declarado' => self::cleanMoney($rate->ValorValorDeclarado),
'entrega_domiciliar' => $rate->EntregaDomiciliar === 'S',
'entrega_sabado' => $rate->EntregaSabado === 'S',
'erro' => array('codigo' => (real) $rate->Erro, 'mensagem' => (real) $rate->MsgErro),
'erro' => array('codigo' => (integer) $rate->Erro, 'mensagem' => (string) $rate->MsgErro),
);
}

Expand Down Expand Up @@ -176,7 +176,8 @@ public function postcode($postcode)
foreach ($children as $child) {
$innerHTML .= $child->ownerDocument->saveXML($child);
}
$item[] = trim(preg_replace("/&#?[a-z0-9]+;/i", "", $innerHTML));
$text = preg_replace("/&#?[a-z0-9]+;/i", "", $innerHTML);
$itens[] = preg_replace(['(\s+)u', '(^\s|\s$)u'], [' ', ''], $text);
}
$data = [];
$data['address'] = trim($item[0], " \t\n\r\0\x0B\xc2\xa0");
Expand Down

0 comments on commit 2b817dc

Please sign in to comment.