more optimizations
This commit is contained in:
@@ -41,7 +41,7 @@ class ElixFormsController
|
||||
$username = $this->config->secret('elixforms_api_username');
|
||||
$password = $this->config->secret('elixforms_api_password');
|
||||
|
||||
if (!is_string($username) || trim($username) === '' || !is_string($password) || $password === '') {
|
||||
if (!\is_string($username) || trim($username) === '' || !\is_string($password) || $password === '') {
|
||||
throw new ElixFormsException('Credenziali elixForms non configurate.');
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class ElixFormsController
|
||||
|
||||
private function requiredString(array $values, string $key): ?string
|
||||
{
|
||||
if (!isset($values[$key]) || !is_string($values[$key])) {
|
||||
if (!isset($values[$key]) || !\is_string($values[$key])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -96,11 +96,11 @@ class ElixFormsController
|
||||
|
||||
private function optionalNonEmptyString(array $values, string $key, string $default): ?string
|
||||
{
|
||||
if (!array_key_exists($key, $values)) {
|
||||
if (!\array_key_exists($key, $values)) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
if (!is_string($values[$key])) {
|
||||
if (!\is_string($values[$key])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class ElixFormsController
|
||||
private function requestId(array $instance)
|
||||
{
|
||||
foreach (['idDomanda', 'requestId', 'idRequest'] as $key) {
|
||||
if (isset($instance[$key]) && (is_int($instance[$key]) || is_string($instance[$key]))) {
|
||||
if (isset($instance[$key]) && (\is_int($instance[$key]) || \is_string($instance[$key]))) {
|
||||
return $instance[$key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user