', ':', '"', '|', '?', '*', ]; public function __construct( private IConfig $config, private FilenameValidator $filenameValidator, private LoggerInterface $logger, ) { } public function hasFilesWindowsSupport(): bool { return empty(array_diff(self::WINDOWS_BASENAMES, $this->filenameValidator->getForbiddenBasenames())) && empty(array_diff(self::WINDOWS_CHARACTERS, $this->filenameValidator->getForbiddenCharacters())) && empty(array_diff(self::WINDOWS_EXTENSION, $this->filenameValidator->getForbiddenExtensions())); } public function setFilesWindowsSupport(bool $enabled = true): void { if ($enabled) { $basenames = array_unique(array_merge(self::WINDOWS_BASENAMES, $this->filenameValidator->getForbiddenBasenames())); $characters = array_unique(array_merge(self::WINDOWS_CHARACTERS, $this->filenameValidator->getForbiddenCharacters())); $extensions = array_unique(array_merge(self::WINDOWS_EXTENSION, $this->filenameValidator->getForbiddenExtensions())); } else { $basenames = array_unique(array_values(array_diff($this->filenameValidator->getForbiddenBasenames(), self::WINDOWS_BASENAMES))); $characters = array_unique(array_values(array_diff($this->filenameValidator->getForbiddenCharacters(), self::WINDOWS_CHARACTERS))); $extensions = array_unique(array_values(array_diff($this->filenameValidator->getForbiddenExtensions(), self::WINDOWS_EXTENSION))); } $values = [ 'forbidden_filename_basenames' => empty($basenames) ? null : $basenames, 'forbidden_filename_characters' => empty($characters) ? null : $characters, 'forbidden_filename_extensions' => empty($extensions) ? null : $extensions, ]; $this->config->setSystemValues($values); } }