. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; /** * FILE_NAME := {Size=1:90} * The name of the GEDCOM transmission file. If the file name includes a file * extension it must be shown in the form (filename.ext). */ class FileName extends AbstractElement { protected const MAXIMUM_LENGTH = 90; /** * Convert a value to a canonical form. * * @param string $value * * @return string */ public function canonical(string $value): string { // Leading/trailing/multiple spaces are valid in filenames. return strtr($value, ["\t" => '', "\r" => '', "\n" => '']); } }