2017 © Pedro Peláez
 

library ensure

Some PHP Traits for ensuring values

image

djthossi/ensure

Some PHP Traits for ensuring values

  • Wednesday, January 25, 2017
  • by DjThossi
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,029 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 9 Versions
  • 9 % Grown

The README.md

Ensure

Some PHP Traits for ensuring values Build Status SensioLabsInsight Code Climate Test Coverage, (*1)

How it works

The provided Ensure Traits will test if provided $valueToTest has expected value. - If $valueToTest is valid nothing happens - If $valueToTest is invalid InvalidValueException is thrown, (*2)

Available Ensure Traits

  • EnsureIsBooleanTrait
  • EnsureIsGreaterThanTrait
  • EnsureIsIntegerTrait
  • EnsureIsLowerThanTrait
  • EnsureIsNotEmptyTrait
  • EnsureIsStringTrait
  • EnsureIsUrlTrait

How to install

You have several options to install this package, (*3)

Composer

composer require djthossi/ensure, (*4)

Git

git clone https://github.com/DjThossi/Ensure.git, (*5)

Download

https://github.com/DjThossi/Ensure/archive/master.zip, (*6)

Example

class Message
{
    use EnsureIsStringTrait;

    const MESSAGE_IS_NOT_A_STRING = 1;

    /**
     * @param string $message
     */
    public function __construct($message)
    {
        $this->ensureIsString('Message', $message, self::MESSAGE_IS_NOT_A_STRING);
    }
}

The Versions

25/01 2017

dev-master

9999999-dev

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

25/01 2017

dev-develop

dev-develop

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

25/01 2017

1.2.0

1.2.0.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

31/12 2016

1.1.0

1.1.0.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

31/12 2016

1.0.4

1.0.4.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

31/12 2016

1.0.3

1.0.3.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

30/12 2016

1.0.2

1.0.2.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

29/12 2016

1.0.1

1.0.1.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

29/12 2016

1.0.0

1.0.0.0

Some PHP Traits for ensuring values

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires