summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/html/src/Contract
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:38:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:38:04 +0000
commit1ff5c35de5dbd70a782875a91dd2232fd01b002b (patch)
tree77d9ce5e1bf78b3e6ef79f8f6e7861e2ced3c09b /vendor/ipl/html/src/Contract
parentInitial commit. (diff)
downloadicinga-php-library-upstream.tar.xz
icinga-php-library-upstream.zip
Adding upstream version 0.10.1.upstream/0.10.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/ipl/html/src/Contract')
-rw-r--r--vendor/ipl/html/src/Contract/FormElement.php125
-rw-r--r--vendor/ipl/html/src/Contract/FormElementDecorator.php18
-rw-r--r--vendor/ipl/html/src/Contract/FormSubmitElement.php13
-rw-r--r--vendor/ipl/html/src/Contract/ValueCandidates.php22
-rw-r--r--vendor/ipl/html/src/Contract/Wrappable.php45
5 files changed, 223 insertions, 0 deletions
diff --git a/vendor/ipl/html/src/Contract/FormElement.php b/vendor/ipl/html/src/Contract/FormElement.php
new file mode 100644
index 0000000..6aa1456
--- /dev/null
+++ b/vendor/ipl/html/src/Contract/FormElement.php
@@ -0,0 +1,125 @@
+<?php
+
+namespace ipl\Html\Contract;
+
+use ipl\Html\Attributes;
+use ipl\Html\Form;
+
+/**
+ * Representation of form elements
+ */
+interface FormElement extends Wrappable
+{
+ /**
+ * Get the attributes or options of the element
+ *
+ * @return Attributes
+ */
+ public function getAttributes();
+
+ /**
+ * Add attributes or options to the form element
+ *
+ * @param iterable $attributes
+ *
+ * @return $this
+ */
+ public function addAttributes($attributes);
+
+ /**
+ * Get the description for the element, if any
+ *
+ * @return string|null
+ */
+ public function getDescription();
+
+ /**
+ * Get the label for the element, if any
+ *
+ * @return string|null
+ */
+ public function getLabel();
+
+ /**
+ * Get the validation error messages
+ *
+ * @return array
+ */
+ public function getMessages();
+
+ /**
+ * Add a validation error message
+ *
+ * @param string $message
+ *
+ * @return $this
+ */
+ public function addMessage($message);
+
+ /**
+ * Get the name of the element
+ *
+ * @return string
+ */
+ public function getName();
+
+ /**
+ * Get whether the element has a value
+ *
+ * @return bool False if the element's value is null, the empty string or the empty array; true otherwise
+ */
+ public function hasValue();
+
+ /**
+ * Get the value of the element
+ *
+ * @return mixed
+ */
+ public function getValue();
+
+ /**
+ * Set the value of the element
+ *
+ * @param mixed $value
+ *
+ * @return $this
+ */
+ public function setValue($value);
+
+ /**
+ * Get whether the element has been validated
+ *
+ * @return bool
+ */
+ public function hasBeenValidated();
+
+ /**
+ * Get whether the element is ignored
+ *
+ * @return bool
+ */
+ public function isIgnored();
+
+ /**
+ * Get whether the element is required
+ *
+ * @return bool
+ */
+ public function isRequired();
+
+ /**
+ * Get whether the element is valid
+ *
+ * @return bool
+ */
+ public function isValid();
+
+ /**
+ * Handler which is called after this element has been registered
+ *
+ * @param Form $form
+ *
+ * @return void
+ */
+ public function onRegistered(Form $form);
+}
diff --git a/vendor/ipl/html/src/Contract/FormElementDecorator.php b/vendor/ipl/html/src/Contract/FormElementDecorator.php
new file mode 100644
index 0000000..1e862bb
--- /dev/null
+++ b/vendor/ipl/html/src/Contract/FormElementDecorator.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace ipl\Html\Contract;
+
+use ipl\Html\ValidHtml;
+
+/**
+ * Representation of form element decorators
+ */
+interface FormElementDecorator extends ValidHtml
+{
+ /**
+ * Decorate the given form element
+ *
+ * @param FormElement $formElement
+ */
+ public function decorate(FormElement $formElement);
+}
diff --git a/vendor/ipl/html/src/Contract/FormSubmitElement.php b/vendor/ipl/html/src/Contract/FormSubmitElement.php
new file mode 100644
index 0000000..4909df8
--- /dev/null
+++ b/vendor/ipl/html/src/Contract/FormSubmitElement.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace ipl\Html\Contract;
+
+interface FormSubmitElement extends FormElement
+{
+ /**
+ * Get whether the element has been pressed
+ *
+ * @return bool
+ */
+ public function hasBeenPressed();
+}
diff --git a/vendor/ipl/html/src/Contract/ValueCandidates.php b/vendor/ipl/html/src/Contract/ValueCandidates.php
new file mode 100644
index 0000000..0271500
--- /dev/null
+++ b/vendor/ipl/html/src/Contract/ValueCandidates.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace ipl\Html\Contract;
+
+interface ValueCandidates
+{
+ /**
+ * Get value candidates of this element
+ *
+ * @return array
+ */
+ public function getValueCandidates();
+
+ /**
+ * Set value candidates of this element
+ *
+ * @param array $values
+ *
+ * @return $this
+ */
+ public function setValueCandidates(array $values);
+}
diff --git a/vendor/ipl/html/src/Contract/Wrappable.php b/vendor/ipl/html/src/Contract/Wrappable.php
new file mode 100644
index 0000000..c8cf924
--- /dev/null
+++ b/vendor/ipl/html/src/Contract/Wrappable.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace ipl\Html\Contract;
+
+use ipl\Html\ValidHtml;
+
+/**
+ * Representation of wrappable elements
+ */
+interface Wrappable extends ValidHtml
+{
+ /**
+ * Get the wrapper, if any
+ *
+ * @return Wrappable|null
+ */
+ public function getWrapper();
+
+ /**
+ * Set the wrapper
+ *
+ * @param Wrappable $wrapper
+ *
+ * @return $this
+ */
+ public function setWrapper(Wrappable $wrapper);
+
+ /**
+ * Add a wrapper
+ *
+ * @param Wrappable $wrapper
+ *
+ * @return $this
+ */
+ public function addWrapper(Wrappable $wrapper);
+
+ /**
+ * Prepend a wrapper
+ *
+ * @param Wrappable $wrapper
+ *
+ * @return $this
+ */
+ public function prependWrapper(Wrappable $wrapper);
+}