Add `IPatternFormField`
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Dec 2020 12:59:57 +0000 (13:59 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 22 Dec 2020 12:59:57 +0000 (13:59 +0100)
wcfsetup/install/files/lib/system/form/builder/field/IPatternFormField.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IPatternFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IPatternFormField.class.php
new file mode 100644 (file)
index 0000000..577e221
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+namespace wcf\system\form\builder\field;
+
+/**
+ * Represents a form field that supports the `pattern` attribute.
+ *
+ * @author      Matthias Schmidt
+ * @copyright   2001-2020 WoltLab GmbH
+ * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package     WoltLabSuite\Core\System\Form\Builder\Field
+ * @see         https://html.spec.whatwg.org/multipage/input.html#attr-input-pattern
+ * @since       5.4
+ */
+interface IPatternFormField {
+       /**
+        * Returns the `pattern` attribute of the form field.
+        *
+        * If `null` is returned, no `pattern` attribute will be set.
+        */
+       public function getPattern(): ?string;
+       
+       /**
+        * Sets the `pattern` attribute of the form field.
+        *
+        * If `null` is given, the attribute is unset.
+        */
+       public function pattern(?string $pattern): self;
+}