. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\Tree; use function e; use function preg_match; /** * ADDRESS_FAX := {Size=5:60} * A FAX telephone number appropriate for sending data facsimiles. */ class AddressFax extends AbstractElement { protected const MAXIMUM_LENGTH = 60; /** * Display the value of this type of element. * * @param string $value * @param Tree $tree * * @return string */ public function value(string $value, Tree $tree): string { if (preg_match('/^[+0-9-]+$/', $value)) { return '' . e($value) . ''; } return e($value); } }