2017 © Pedro Peláez
 

library php-arguments

Utility class for method arguments validation.

image

robotdance/php-arguments

Utility class for method arguments validation.

  • Wednesday, June 1, 2016
  • by MarcosMenegazzo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 121 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PHP-Arguments

Code Climate Test Coverage Issue Count, (*1)

Formerly monochromist/php-arguments, (*2)

PHP-Arguments is an utility class for arguments validation code. Nothing special here, just some utility methods for libraries that need to enforce arguments validation and provide better error messages to developers using a library., (*3)

Example

use robotdance/Arguments;
...
public function doSomething($arg1, $arg2, $arg3, $arg4) {
  // string or boolean required
  Arguments::validate($arg1, ['string', 'boolean'];
  // integer required
  Arguments::validate($arg2, ['integer']);
  // not null required
  Arguments::notNull($arg3);
  // check if $arg4 is a string=>any associative array
  Arguments::validateAssociativeArray($arg4);
}

Setup

PHP-Arguments uses Composer as dependency manager., (*4)

$ composer install, (*5)

You may also generate documentation:, (*6)

$ ./bin/phpdoc -d ./src/ -t ./docs/, (*7)

Testing

$ ./bin/phpunit, (*8)

Contribute

Simply fork, code your tests and modifications, write a good commit message and submit a pull request. All tests must pass and the coverage must remains at 100%., (*9)

References

PHP the right way, (*10)

The Versions

01/06 2016

dev-master

9999999-dev https://github.com/robotdance/php-arguments

Utility class for method arguments validation.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Marcos Menegazzo

function php validation utility method arguments

01/06 2016

v0.0.4

0.0.4.0 https://github.com/robotdance/php-arguments

Utility class for method arguments validation.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Marcos Menegazzo

function php validation utility method arguments

31/05 2016

v0.0.3

0.0.3.0 https://github.com/monochromist/php-arguments

Utility class for method arguments validation.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Marcos Menegazzo

function php validation utility method arguments

31/05 2016

v0.0.2

0.0.2.0 https://github.com/monochromist/php-arguments

Utility class for method arguments validation.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Marcos Menegazzo

function php validation utility method arguments

31/05 2016

v0.0.1

0.0.1.0 https://github.com/monochromist/php-arguments

Utility class for method arguments validation.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Marcos Menegazzo

function php validation utility method arguments