Upgrade to 3.8.0
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Kirby\Form;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Kirby\Cms\App;
|
||||
use Kirby\Cms\HasSiblings;
|
||||
@@ -162,7 +163,7 @@ abstract class FieldClass
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function after(): ?string
|
||||
public function after(): string|null
|
||||
{
|
||||
return $this->stringTemplate($this->after);
|
||||
}
|
||||
@@ -186,7 +187,7 @@ abstract class FieldClass
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function before(): ?string
|
||||
public function before(): string|null
|
||||
{
|
||||
return $this->stringTemplate($this->before);
|
||||
}
|
||||
@@ -259,7 +260,7 @@ abstract class FieldClass
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function help(): ?string
|
||||
public function help(): string|null
|
||||
{
|
||||
if (empty($this->help) === false) {
|
||||
$help = $this->stringTemplate($this->help);
|
||||
@@ -274,7 +275,7 @@ abstract class FieldClass
|
||||
* @param string|array|null $param
|
||||
* @return string|null
|
||||
*/
|
||||
protected function i18n($param = null): ?string
|
||||
protected function i18n($param = null): string|null
|
||||
{
|
||||
return empty($param) === false ? I18n::translate($param, $param) : null;
|
||||
}
|
||||
@@ -284,7 +285,7 @@ abstract class FieldClass
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function icon(): ?string
|
||||
public function icon(): string|null
|
||||
{
|
||||
return $this->icon;
|
||||
}
|
||||
@@ -457,7 +458,7 @@ abstract class FieldClass
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function placeholder(): ?string
|
||||
public function placeholder(): string|null
|
||||
{
|
||||
return $this->stringTemplate($this->placeholder);
|
||||
}
|
||||
@@ -578,7 +579,7 @@ abstract class FieldClass
|
||||
* @param string|null $icon
|
||||
* @return void
|
||||
*/
|
||||
protected function setIcon(?string $icon = null)
|
||||
protected function setIcon(string|null $icon = null)
|
||||
{
|
||||
$this->icon = $icon;
|
||||
}
|
||||
@@ -684,7 +685,7 @@ abstract class FieldClass
|
||||
* @param string|null $string
|
||||
* @return string|null
|
||||
*/
|
||||
protected function stringTemplate(?string $string = null): ?string
|
||||
protected function stringTemplate(string|null $string = null): string|null
|
||||
{
|
||||
if ($string !== null) {
|
||||
return $this->model->toString($string);
|
||||
@@ -767,7 +768,7 @@ abstract class FieldClass
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_a($validation, 'Closure') === true) {
|
||||
if ($validation instanceof Closure) {
|
||||
try {
|
||||
$validation->call($this, $value);
|
||||
} catch (Exception $e) {
|
||||
@@ -816,7 +817,7 @@ abstract class FieldClass
|
||||
{
|
||||
try {
|
||||
return Data::decode($value, 'json');
|
||||
} catch (Throwable $e) {
|
||||
} catch (Throwable) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -858,7 +859,7 @@ abstract class FieldClass
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function when(): ?array
|
||||
public function when(): array|null
|
||||
{
|
||||
return $this->when;
|
||||
}
|
||||
|
Reference in New Issue
Block a user