Adds some PHP 8 ready changes to compiler classes. Adds Server and Crypt classes.
This commit is contained in:
@@ -102,8 +102,8 @@ class Customcode
|
||||
= true;
|
||||
}
|
||||
|
||||
if (strpos($field->javascript_view_footer, "token") !== false
|
||||
|| strpos($field->javascript_view_footer, "task=ajax") !== false)
|
||||
if (strpos((string) $field->javascript_view_footer, "token") !== false
|
||||
|| strpos((string) $field->javascript_view_footer, "task=ajax") !== false)
|
||||
{
|
||||
if (!isset($this->dispenser->hub['token']))
|
||||
{
|
||||
@@ -182,8 +182,8 @@ class Customcode
|
||||
{
|
||||
$field->javascript_views_footer_decoded = true;
|
||||
}
|
||||
if (strpos($field->javascript_views_footer, "token") !== false
|
||||
|| strpos($field->javascript_views_footer, "task=ajax") !== false)
|
||||
if (strpos((string) $field->javascript_views_footer, "token") !== false
|
||||
|| strpos((string) $field->javascript_views_footer, "task=ajax") !== false)
|
||||
{
|
||||
if (!isset($this->dispenser->hub['token']))
|
||||
{
|
||||
|
@@ -196,7 +196,7 @@ class Data
|
||||
$field->type = $field->fieldtype;
|
||||
|
||||
// load the values form params
|
||||
$field->xml = $this->customcode->update(json_decode($field->xml));
|
||||
$field->xml = $this->customcode->update(json_decode((string) $field->xml));
|
||||
|
||||
// check if we have validate (validation rule and set it if found)
|
||||
$this->validation->set($id, $field->xml);
|
||||
@@ -204,7 +204,7 @@ class Data
|
||||
// load the type values form type params
|
||||
$field->properties = (isset($field->properties)
|
||||
&& JsonHelper::check($field->properties))
|
||||
? json_decode($field->properties, true) : null;
|
||||
? json_decode((string) $field->properties, true) : null;
|
||||
if (ArrayHelper::check($field->properties))
|
||||
{
|
||||
$field->properties = array_values($field->properties);
|
||||
@@ -243,13 +243,13 @@ class Data
|
||||
))
|
||||
{
|
||||
$field->initiator_save_key = md5(
|
||||
$field->initiator_on_save_model
|
||||
(string) $field->initiator_on_save_model
|
||||
);
|
||||
$field->initiator_save = explode(
|
||||
PHP_EOL, $this->placeholder->update_(
|
||||
$this->customcode->update(
|
||||
base64_decode(
|
||||
$field->initiator_on_save_model
|
||||
(string) $field->initiator_on_save_model
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -260,13 +260,13 @@ class Data
|
||||
))
|
||||
{
|
||||
$field->initiator_get_key = md5(
|
||||
$field->initiator_on_get_model
|
||||
(string) $field->initiator_on_get_model
|
||||
);
|
||||
$field->initiator_get = explode(
|
||||
PHP_EOL, $this->placeholder->update_(
|
||||
$this->customcode->update(
|
||||
base64_decode(
|
||||
$field->initiator_on_get_model
|
||||
(string) $field->initiator_on_get_model
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -276,14 +276,14 @@ class Data
|
||||
$field->model_field['save'] = explode(
|
||||
PHP_EOL, $this->placeholder->update_(
|
||||
$this->customcode->update(
|
||||
base64_decode($field->on_save_model_field)
|
||||
base64_decode((string) $field->on_save_model_field)
|
||||
)
|
||||
)
|
||||
);
|
||||
$field->model_field['get'] = explode(
|
||||
PHP_EOL, $this->placeholder->update_(
|
||||
$this->customcode->update(
|
||||
base64_decode($field->on_get_model_field)
|
||||
base64_decode((string) $field->on_get_model_field)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@@ -88,7 +88,7 @@ class CoreValidation implements CoreValidationInterface
|
||||
}
|
||||
|
||||
// remove the Rule.php from the name
|
||||
$this->rules = array_map( function ($name) {
|
||||
$this->rules = array_map( function ($name): string {
|
||||
return str_replace(array('./','Rule.php'), '', $name);
|
||||
}, $rules);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ class CoreValidation implements CoreValidationInterface
|
||||
// check if the names should be all lowercase
|
||||
if ($lowercase)
|
||||
{
|
||||
return array_map( function($item) {
|
||||
return array_map( function($item): string {
|
||||
return strtolower($item);
|
||||
}, $this->rules);
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ class TypeName
|
||||
))
|
||||
{
|
||||
// search for own custom fields
|
||||
if (strpos($field['settings']->type_name, '@') !== false)
|
||||
if (strpos((string) $field['settings']->type_name, '@') !== false)
|
||||
{
|
||||
// set own custom field
|
||||
$field['settings']->own_custom = $field['settings']->type_name;
|
||||
@@ -66,8 +66,8 @@ class TypeName
|
||||
);
|
||||
|
||||
// if custom (we must use the xml value)
|
||||
if (strtolower($type_name) === 'custom'
|
||||
|| strtolower($type_name) === 'customuser')
|
||||
if (strtolower((string) $type_name) === 'custom'
|
||||
|| strtolower((string) $type_name) === 'customuser')
|
||||
{
|
||||
$type = TypeHelper::safe(
|
||||
GetHelper::between(
|
||||
|
@@ -133,7 +133,7 @@ class Validation
|
||||
$this->placeholder->update_(
|
||||
$this->customcode->update(
|
||||
base64_decode(
|
||||
$php_code
|
||||
(string) $php_code
|
||||
)
|
||||
)
|
||||
),
|
||||
|
Reference in New Issue
Block a user