mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Fix minori
This commit is contained in:
parent
44125403df
commit
608199dffd
@ -50,7 +50,7 @@
|
|||||||
"symfony/var-dumper": "^3.3"
|
"symfony/var-dumper": "^3.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"codeception/codeception": "^2.4",
|
"codeception/codeception": "2.4.*",
|
||||||
"friendsofphp/php-cs-fixer": "^2.10"
|
"friendsofphp/php-cs-fixer": "^2.10"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model as Original;
|
|||||||
|
|
||||||
abstract class Model extends Original
|
abstract class Model extends Original
|
||||||
{
|
{
|
||||||
|
const UPDATED_AT = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crea una nuova istanza del modello.
|
* Crea una nuova istanza del modello.
|
||||||
*
|
*
|
||||||
|
@ -151,10 +151,23 @@ class Formatter
|
|||||||
public function parseNumber($value)
|
public function parseNumber($value)
|
||||||
{
|
{
|
||||||
// Controllo sull'effettiva natura del numero
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$value = $sign.$value;
|
||||||
|
|
||||||
if (is_object($this->numberFormatter)) {
|
if (is_object($this->numberFormatter)) {
|
||||||
$result = $this->numberFormatter->parse($value);
|
$result = $this->numberFormatter->parse($value);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user