function FileTestSaveUploadFromForm::fileExistsFromName

Same name in other branches
  1. 10 core/modules/file/tests/file_test/src/Form/FileTestSaveUploadFromForm.php \Drupal\file_test\Form\FileTestSaveUploadFromForm::fileExistsFromName()

Get a FileExists enum from its name.

1 call to FileTestSaveUploadFromForm::fileExistsFromName()
FileTestSaveUploadFromForm::validateForm in core/modules/file/tests/file_test/src/Form/FileTestSaveUploadFromForm.php

File

core/modules/file/tests/file_test/src/Form/FileTestSaveUploadFromForm.php, line 196

Class

FileTestSaveUploadFromForm
File test form class.

Namespace

Drupal\file_test\Form

Code

protected static function fileExistsFromName(string $name) : FileExists {
    return match ($name) {    FileExists::Replace->name => FileExists::Replace,
        FileExists::Error->name => FileExists::Error,
        default => FileExists::Rename,
    
    };
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.