mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 18:04:37 -04:00
Fixes for PHP 8
This commit is contained in:
parent
087129788b
commit
633210e281
@ -49,7 +49,7 @@ class Helpers
|
|||||||
*
|
*
|
||||||
* @return null|string
|
* @return null|string
|
||||||
*/
|
*/
|
||||||
public function formatCustomFieldValue($custom_fields = null, $field, $value, Client $client = null): ?string
|
public function formatCustomFieldValue($custom_fields, $field, $value, Client $client = null): ?string
|
||||||
{
|
{
|
||||||
$custom_field = '';
|
$custom_field = '';
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class Helpers
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function makeCustomField($custom_fields = null, $field): string
|
public function makeCustomField($custom_fields, $field): string
|
||||||
{
|
{
|
||||||
if ($custom_fields && property_exists($custom_fields, $field)) {
|
if ($custom_fields && property_exists($custom_fields, $field)) {
|
||||||
$custom_field = $custom_fields->{$field};
|
$custom_field = $custom_fields->{$field};
|
||||||
|
@ -217,13 +217,17 @@ trait CompanySettingsSaver
|
|||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'int':
|
case 'int':
|
||||||
case 'integer':
|
case 'integer':
|
||||||
return ctype_digit(strval(abs($value)));
|
if(is_string($value))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return is_int($value) || ctype_digit(strval(abs($value)));
|
||||||
case 'real':
|
case 'real':
|
||||||
case 'float':
|
case 'float':
|
||||||
case 'double':
|
case 'double':
|
||||||
return is_float($value) || is_numeric(strval($value));
|
return is_float($value) || is_numeric(strval($value));
|
||||||
case 'string':
|
case 'string':
|
||||||
return method_exists($value, '__toString') || is_null($value) || is_string($value);
|
// return method_exists($value, '__toString') || is_null($value) || is_string($value);
|
||||||
|
return is_null($value) || is_string($value);
|
||||||
case 'bool':
|
case 'bool':
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
return is_bool($value) || (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
return is_bool($value) || (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user