Fix minori

This commit is contained in:
Thomas Zilio 2018-10-20 09:50:52 +02:00
parent 44125403df
commit 608199dffd
3 changed files with 17 additions and 2 deletions

View File

@ -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": {

View File

@ -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.
*

View File

@ -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 {