Skip to content

Releases: nonamephp/php7-common

Collection: Get multiple items by key

12 Mar 19:44
Compare
Choose a tag to compare

An array of keys can be passed to get() to retrieve multiple items from the collection as an array.

0.3.0

22 Dec 04:53
Compare
Choose a tag to compare
  • Added addType() which allows custom types to be defined.
  • Types can now extend other types, allowing for more complex rule configuration.
  • Changed closure/callable validator signature from ($name, $value, $validator) to ($value, $rule, $validator) to match built-in validator signatures better. The name of the field is available through $rule['name'].
  • Dropped closure validator type (e.g. isClosure()).

0.2.8

05 Nov 23:40
Compare
Choose a tag to compare

Added support for array types (e.g. int[])

0.2.7

03 Nov 21:52
Compare
Choose a tag to compare
  • Rules may now be a closure/callable or you can pass a validator key equal to a closure/callable along with your rule array. See issue #4 for more information.
  • required is set to true by default for rules where required is not set. You may override this value per rule by setting required equal to false.
  • Added new any type that always returns true.

0.2.6

02 Nov 04:32
Compare
Choose a tag to compare

Added ability to set and get values and rules from Validator instance.

0.2.5

01 Nov 19:09
Compare
Choose a tag to compare

Added phpcs as dev dependency for checking if code is PSR2 compliant.

0.2.4

01 Nov 17:40
Compare
Choose a tag to compare

Allow rule array to be passed to static type validator methods:

<?php
use Noname\Common\Validator;

Validator::is('date', '2016-01-01', ['format' => 'Y-m-d']);
Validator::isDate('2016-01-01', ['format' => 'Y-m-d']);

0.2.3

01 Nov 16:50
Compare
Choose a tag to compare

Added date/datetime validator types to Validator.

0.2.1

01 Nov 16:49
Compare
Choose a tag to compare

Added static methods to validate types.

<?php
use \Noname\Common\Validator;

// You can validate a type in one of the following ways
Validate::is('string', 'Hello world!');
Validate::isString('Hello world!');

0.2.0

28 Sep 02:35
Compare
Choose a tag to compare

Added \Noname\Common\Validator