====
composer install eden/validation
====
Instantiate validation in this manner.
$validation = eden('validation', 'foobar');
====
====
Returns true if the value is a given type
eden('validation', 'foo')->isType(*string $type, bool $soft);
-
*string $type
- The data type to check for -
bool $soft
- This is like == vs ===
Returns bool
Example 1
eden('validation', 'foo')->isType('email');
Example 2
eden('validation', 'foo')->isType('url');
Example 3
eden('validation', 'foo')->isType('hex');
Example 4
eden('validation', 'foo')->isType('cc');
Example 5
eden('validation', 'foo')->isType('int');
Example 6
eden('validation', 'foo')->isType('float');
Example 7
eden('validation', 'foo')->isType('bool');
====
Returns true if the value is greater than the passed argument
eden('validation', 'foo')->greaterThan(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->greaterThan(123);
====
Returns true if the value is greater or equal to than the passed argument
eden('validation', 'foo')->greaterThanEqualTo(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->greaterThanEqualTo(123);
====
Returns true if the value is less than the passed argument
eden('validation', 'foo')->lessThan(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->lessThan(123);
====
Returns true if the value is less than or equal the passed argument
eden('validation', 'foo')->lessThanEqualTo(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->lessThanEqualTo(123);
====
Returns true if the value length is greater than the passed argument
eden('validation', 'foo')->lengthGreaterThan(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->lengthGreaterThan(123);
====
Returns true if the value length is greater than or equal to the passed argument
eden('validation', 'foo')->lengthGreaterThanEqualTo(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->lengthGreaterThanEqualTo(123);
====
Returns true if the value length is less than the passed argument
eden('validation', 'foo')->lengthLessThan(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->lengthLessThan(123);
====
Returns true if the value length is less than or equal to the passed argument
eden('validation', 'foo')->lengthLessThanEqualTo(*int $number);
-
*int $number
- Number to test against
Returns bool
eden('validation', 'foo')->lengthLessThanEqualTo(123);
====
Returns true if the value is not empty
eden('validation', 'foo')->notEmpty();
Returns bool
====
Returns true if the value starts with a specific letter
eden('validation', 'foo')->startsWithLetter();
Returns bool
====
Returns true if the value is alpha numeric
eden('validation', 'foo')->alphaNumeric();
Returns bool
====
Returns true if the value is alpha numeric underscore
eden('validation', 'foo')->alphaNumericUnderScore();
Returns bool
====
Returns true if the value is alpha numeric hyphen
eden('validation', 'foo')->alphaNumericHyphen();
Returns bool
====
Returns true if the value is alpha numeric hyphen or underscore
eden('validation', 'foo')->alphaNumericLine();
Returns bool
====
Sets the value to be validated
eden('validation', 'foo')->set(*mixed $value);
-
*mixed $value
- value
Returns Eden\Validation\Index
eden('validation', 'foo')->set($value);
====
Contributions to Eden are following the Github work flow. Please read up before contributing.
##Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
##Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.