Fix minori
This commit is contained in:
parent
44125403df
commit
608199dffd
|
@ -50,7 +50,7 @@
|
|||
"symfony/var-dumper": "^3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^2.4",
|
||||
"codeception/codeception": "2.4.*",
|
||||
"friendsofphp/php-cs-fixer": "^2.10"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
|
@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model as Original;
|
|||
|
||||
abstract class Model extends Original
|
||||
{
|
||||
const UPDATED_AT = null;
|
||||
|
||||
/**
|
||||
* Crea una nuova istanza del modello.
|
||||
*
|
||||
|
|
|
@ -151,10 +151,23 @@ class Formatter
|
|||
public function parseNumber($value)
|
||||
{
|
||||
// Controllo sull'effettiva natura del numero
|
||||
if (is_numeric($value)) {
|
||||
$sign = null;
|
||||
if ($value[0] == '+' || $value[0] == '-') {
|
||||
$sign = $value[0];
|
||||
$value = substr($value, 1);
|
||||
}
|
||||
|
||||
$number = str_replace(array_values($this->getNumberSeparators()), '', $value);
|
||||
|
||||
$pieces = explode($this->getNumberSeparators()['decimals'], $value);
|
||||
$integer = str_replace(array_values($this->getNumberSeparators()), '', $pieces[0]);
|
||||
|
||||
if (!ctype_digit($number) || (strlen($integer) != strlen((int) $integer))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $sign.$value;
|
||||
|
||||
if (is_object($this->numberFormatter)) {
|
||||
$result = $this->numberFormatter->parse($value);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue