. */ declare(strict_types=1); namespace App\Settings\SystemSettings; use Jbtronics\SettingsBundle\Metadata\EnvVarMode; use Jbtronics\SettingsBundle\Settings\Settings; use Jbtronics\SettingsBundle\Settings\SettingsParameter; use Jbtronics\SettingsBundle\Settings\SettingsTrait; use Symfony\Component\Translation\TranslatableMessage as TM; use Symfony\Component\Validator\Constraints as Assert; #[Settings(label: new TM("settings.system.attachments"))] class AttachmentsSettings { use SettingsTrait; #[SettingsParameter( label: new TM("settings.system.attachments.maxFileSize"), description: new TM("settings.system.attachments.maxFileSize.help"), envVar: "MAX_ATTACHMENT_FILE_SIZE", envVarMode: EnvVarMode::OVERWRITE )] #[Assert\Regex("/^([1-9][0-9]*)([KMG])?$/", message: "validator.fileSize.invalidFormat")] public string $maxFileSize = '100M'; #[SettingsParameter( label: new TM("settings.system.attachments.allowDownloads"), description: new TM("settings.system.attachments.allowDownloads.help"), formOptions: ['help_html' => true], envVar: "bool:ALLOW_ATTACHMENT_DOWNLOADS", envVarMode: EnvVarMode::OVERWRITE )] public bool $allowDownloads = false; #[SettingsParameter( label: new TM("settings.system.attachments.downloadByDefault"), envVar: "bool:ATTACHMENT_DOWNLOAD_BY_DEFAULT", envVarMode: EnvVarMode::OVERWRITE )] public bool $downloadByDefault = false; }