2017 © Pedro Peláez
 

library validation

Eden validation component.

image

eden/validation

Eden validation component.

  • Friday, November 13, 2015
  • by cblanquera
  • Repository
  • 14 Watchers
  • 0 Stars
  • 8,131 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

logo Eden Validation

Build Status

====, (*1)

, (*2)

Install

composer install eden/validation, (*3)

====, (*4)

, (*5)

Introduction

Instantiate validation in this manner., (*6)

$validation = eden('validation', 'foobar');

====, (*7)

, (*8)

API

====, (*9)

, (*10)

isType

Returns true if the value is a given type, (*11)

Usage

eden('validation', 'foo')->isType(*string $type, bool $soft);

Parameters

  • *string $type - The data type to check for
  • bool $soft - This is like == vs ===

Returns bool, (*12)

Example

Example 1, (*13)

eden('validation', 'foo')->isType('email');

Example 2, (*14)

eden('validation', 'foo')->isType('url');

Example 3, (*15)

eden('validation', 'foo')->isType('hex');

Example 4, (*16)

eden('validation', 'foo')->isType('cc');

Example 5, (*17)

eden('validation', 'foo')->isType('int');

Example 6, (*18)

eden('validation', 'foo')->isType('float');

Example 7, (*19)

eden('validation', 'foo')->isType('bool');

====, (*20)

, (*21)

greaterThan

Returns true if the value is greater than the passed argument, (*22)

Usage

eden('validation', 'foo')->greaterThan(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*23)

Example

eden('validation', 'foo')->greaterThan(123);

====, (*24)

, (*25)

greaterThanEqualTo

Returns true if the value is greater or equal to than the passed argument, (*26)

Usage

eden('validation', 'foo')->greaterThanEqualTo(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*27)

Example

eden('validation', 'foo')->greaterThanEqualTo(123);

====, (*28)

, (*29)

lessThan

Returns true if the value is less than the passed argument, (*30)

Usage

eden('validation', 'foo')->lessThan(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*31)

Example

eden('validation', 'foo')->lessThan(123);

====, (*32)

, (*33)

lessThanEqualTo

Returns true if the value is less than or equal the passed argument, (*34)

Usage

eden('validation', 'foo')->lessThanEqualTo(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*35)

Example

eden('validation', 'foo')->lessThanEqualTo(123);

====, (*36)

, (*37)

lengthGreaterThan

Returns true if the value length is greater than the passed argument, (*38)

Usage

eden('validation', 'foo')->lengthGreaterThan(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*39)

Example

eden('validation', 'foo')->lengthGreaterThan(123);

====, (*40)

, (*41)

lengthGreaterThanEqualTo

Returns true if the value length is greater than or equal to the passed argument, (*42)

Usage

eden('validation', 'foo')->lengthGreaterThanEqualTo(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*43)

Example

eden('validation', 'foo')->lengthGreaterThanEqualTo(123);

====, (*44)

, (*45)

lengthLessThan

Returns true if the value length is less than the passed argument, (*46)

Usage

eden('validation', 'foo')->lengthLessThan(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*47)

Example

eden('validation', 'foo')->lengthLessThan(123);

====, (*48)

, (*49)

lengthLessThanEqualTo

Returns true if the value length is less than or equal to the passed argument, (*50)

Usage

eden('validation', 'foo')->lengthLessThanEqualTo(*int $number);

Parameters

  • *int $number - Number to test against

Returns bool, (*51)

Example

eden('validation', 'foo')->lengthLessThanEqualTo(123);

====, (*52)

, (*53)

notEmpty

Returns true if the value is not empty, (*54)

Usage

eden('validation', 'foo')->notEmpty();

Parameters

Returns bool, (*55)

====, (*56)

, (*57)

startsWithLetter

Returns true if the value starts with a specific letter, (*58)

Usage

eden('validation', 'foo')->startsWithLetter();

Parameters

Returns bool, (*59)

====, (*60)

, (*61)

alphaNumeric

Returns true if the value is alpha numeric, (*62)

Usage

eden('validation', 'foo')->alphaNumeric();

Parameters

Returns bool, (*63)

====, (*64)

, (*65)

alphaNumericUnderScore

Returns true if the value is alpha numeric underscore, (*66)

Usage

eden('validation', 'foo')->alphaNumericUnderScore();

Parameters

Returns bool, (*67)

====, (*68)

, (*69)

alphaNumericHyphen

Returns true if the value is alpha numeric hyphen, (*70)

Usage

eden('validation', 'foo')->alphaNumericHyphen();

Parameters

Returns bool, (*71)

====, (*72)

, (*73)

alphaNumericLine

Returns true if the value is alpha numeric hyphen or underscore, (*74)

Usage

eden('validation', 'foo')->alphaNumericLine();

Parameters

Returns bool, (*75)

====, (*76)

, (*77)

set

Sets the value to be validated, (*78)

Usage

eden('validation', 'foo')->set(*mixed $value);

Parameters

  • *mixed $value - value

Returns Eden\Validation\Index, (*79)

Example

eden('validation', 'foo')->set($value);

====, (*80)

, (*81)

Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing., (*82)

Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. 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
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

The Versions

13/11 2015

dev-master

9999999-dev http://eden-php.com

Eden validation component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/11 2015

4.x-dev

4.9999999.9999999.9999999-dev http://eden-php.com

Eden validation component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/10 2015

4.0.1

4.0.1.0 http://eden-php.com

Eden validation component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

07/10 2015

v4

4.0.0.0 http://eden-php.com

Eden validation component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/09 2013

1.0.3

1.0.3.0 http://eden-php.com

Eden validation component

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/09 2013

1.0.2

1.0.2.0 http://eden-php.com

Eden validation component

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden