Add `IAutoCompleteFormField`
authorMatthias Schmidt <gravatronics@live.com>
Sat, 19 Dec 2020 12:14:54 +0000 (13:14 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 17:51:23 +0000 (18:51 +0100)
wcfsetup/install/files/lib/system/form/builder/field/IAutoCompleteFormField.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IAutoCompleteFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IAutoCompleteFormField.class.php
new file mode 100644 (file)
index 0000000..f3543e3
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+namespace wcf\system\form\builder\field;
+
+/**
+ * Represents a form field that supports the `autocomplete` 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/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute
+ * @since       5.4
+ */
+interface IAutoCompleteFormField {
+       /**
+        * Sets the `autocomplete` attribute of the form field.
+        *
+        * Multiple tokens can be separated by spaces and if `null` is given, the attribute is unset.
+        *
+        * @throws      \InvalidArgumentException       if an invalid `autocomplete` token is included in the attribute value
+        */
+       public function autoComplete(?string $autocomplete): self;
+       
+       /**
+        * Returns the `autocomplete` attribute of the form field.
+        *
+        * If `null` is returned, no `autocomplete` attribute will be set.
+        */
+       public function getAutoComplete(): ?string;
+}