2017 © Pedro Peláez
 

library ordono

Simple input validation

image

gnugat/ordono

Simple input validation

  • Wednesday, August 27, 2014
  • by gnupat
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Ordono

Simple input validation., (*1)

You'll no longer have to do the following:, (*2)

if (!isset($input['content'])) {
    throw new \RuntimeException('The required option "content" is missing.');
}
if (!is_string($input['content'])) {
    throw new \RuntimeException('The option "content" is expected to be of type "string"');
}
if (!isset($input['author'])) {
    throw new \RuntimeException('The required option "author" is missing.');
}
if (!is_string($input['author'])) {
    throw new \RuntimeException('The option "author" is expected to be of type "string"');
}

With Ordono, keep a clean validation:, (*3)

use Gnugat\Ordono\CommandResolver;

$command = new CreateQuoteCommand(); // Definition of a valid input
$commandResolver = new CommandResolver();
// $commandResolver->addConverter(new Symfony2RequestConverter());
$commandResolver->resolve($command, $input); // Throws exceptions if something is wrong

Installation

Use Composer to install Ordono in your project:, (*4)

composer require gnugat/ordono:~1.0

Further documentation

You can see the current and past versions using one of the following:, (*5)

You can find more documentation at the following links:, (*6)

Next readings

The Versions

27/08 2014

dev-master

9999999-dev

Simple input validation

  Sources   Download

MIT

The Requires

 

The Development Requires

command validation input options

26/08 2014

v1.0.0

1.0.0.0

Simple input validation

  Sources   Download

MIT

The Requires

 

The Development Requires

command validation input options