2024-05-06 16:00:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Modules\Plugins\Manifest;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property 'text'|'email'|'url'|'markdown'|'number'|'switch' $type
|
|
|
|
* @property string $key
|
|
|
|
* @property string $label
|
|
|
|
* @property string $hint
|
|
|
|
* @property string $helper
|
|
|
|
* @property bool $optional
|
|
|
|
*/
|
|
|
|
class SettingsField extends ManifestObject
|
|
|
|
{
|
|
|
|
protected const VALIDATION_RULES = [
|
|
|
|
'type' => 'permit_empty|in_list[text,email,url,markdown,number,switch]',
|
|
|
|
'key' => 'required|alpha_dash',
|
|
|
|
'label' => 'required|string',
|
|
|
|
'hint' => 'permit_empty|string',
|
|
|
|
'helper' => 'permit_empty|string',
|
|
|
|
'optional' => 'permit_empty|is_boolean',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected string $type = 'text';
|
|
|
|
|
|
|
|
protected string $key;
|
|
|
|
|
|
|
|
protected string $label;
|
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
protected string $hint = '';
|
2024-05-06 16:00:47 +00:00
|
|
|
|
2024-05-09 17:55:41 +00:00
|
|
|
protected string $helper = '';
|
2024-05-06 16:00:47 +00:00
|
|
|
|
|
|
|
protected bool $optional = false;
|
|
|
|
}
|