Predicate-Common
The common predicates on PHP variables
Code example
Example of the predicate which tests that a subject starts with a 'Hello' string or is equal to a 'Welcome!' string.
use Predicate as P;
$pr = (new P\StartsWith('Hello'))->or(new IsEqualTo('Welcome!'));
$pr('Hi John!'); // → false
$pr('Welcome!'); // → true
$pr('Hello John!'); // → true
Documentation
See the documentation of API at gh-pages.
Installation
Install this package using the composer command:
$ composer require "predicate/predicate-common"
Tests
To run the tests execute the command:
$ php vendor/bin/phpunit
Build
To start the build process run the command:
$ php vendor/bin/phing
License
The MIT License (MIT)
Copyright (c) 2016 Krzysztof Piasecki