Skip to content

Releases: dealnews/constraints

Bug Fix

19 Jan 22:26
f8d5d27
Compare
Choose a tag to compare

Bug fix with checking sub-constraints of arrays

v2.2.0

20 Nov 17:14
Compare
Choose a tag to compare

Development improvements and bug fixes

Arrays can have constraints for its contents

29 Mar 21:16
Compare
Choose a tag to compare

An array constraint can now have a 'constraint' inside of itself that defines the constraint to apply to its contents.

Example:

$constraint = \DealNews\Constraints\Constraint::init();
$value = ["1"];
try {
    $value = $constraint->check($value, ["type" => "array", "constraint" => ["type" => "integer"]]);
    // $value will now be [1]
} catch (\DealNews\Constraints\ConstraintException $e) {
    echo $e->getMessage();
}

Coding Standards Update

17 Jan 20:12
Compare
Choose a tag to compare

Updated to match the DealNews coding standards

Initial Public Release

10 Mar 15:25
Compare
Choose a tag to compare

This code has been in use internally at DealNews for a while. This is the initial public release.