Releases: PhpGt/DomValidation
CI and QA improvements
Stable release with DOM v4
This is the v1 release for DomValidation which comes with a variety of default rules, along with the ability to extend the ruleset with custom rules.
What's Changed
- Update to use PHP.Gt/DOM's facade by @g105b in #20
- Implement radiobox validation by @g105b in #23
- build: hard dependencies by @g105b in #25
- maintenance: tidy up for #28 by @g105b in #31
- maintenance: dependabot by @g105b in #27
- ci: scrutinizer phpunit by @g105b in #32
- feature: extend with custom rule by @g105b in #34
Full Changelog: v0.3.2...v1.0.0
May 2021 update
In this release, we introduce/test the following validation features:
- The pattern attribute, and how it displays the title attribute on error.
- Minimum length and maximum length.
- Adding a hint to the validation message from within the HTML.
- PHP 8 compatibility.
Better type safety & CI
This patch pre-release increases the code quality by inserting much better type hinting throughout.
Github Actions has been implemented, replacing CircleCI, so all tests are in one single place.
<select> element implementation
The introduction of <select>
validation is released in v0.3.0.
The following rules apply:
- If a
<select>
element is submitted, its available<option>
elements are inspected. - If the
required
attribute is present, a value must be sent. - Only values available within
<option>
elements are considered valid. <option>
elements can have avalue
attribute to indicate their value, otherwise their text content will be used.
All <input> types implemented
The W3C specification for input types is available at: https://www.w3.org/TR/html51/sec-forms.html#sec-states-of-the-type-attribute
Implemented:
type=hidden(no validation required)type=text(no validation required)type=search(no validation required)- type=tel
- type=url
- type=email
type=password(no validation required)- type=date
- type=month
- type=week
- type=time
- type=datetime-local
- type=number
- type=range
Refactored tests
Tests are strengthened and refactored for week and number inputs.
Date formats
In this release, the following date validation formats are introduced:
type=date
type=month
type=week
type=datetime-local
All of these types are defined within the TypeDate
Rule class.
Number type with min, max, range, step
When an input element’s type attribute is in the Number state, the rules in this release apply. The input element represents a control for setting the element’s value to a string representing a number.
Included in this release are the following features:
- type=number rule
- type=range rule
- min
- max
- step
Regular expression patterns
The pattern attribute specifies a regular expression against which the control’s value.
Constraint validation: If the element’s value is not the empty string, and the element has a compiled pattern regular expression but that regular expression does not match the entirety of the element’s value, then the element is suffering from a pattern mismatch.