gnugat / ordono
Simple input validation
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
pkg:composer/gnugat/ordono
Requires
- php: >=5.3.3
 - symfony/options-resolver: ~2.0
 
Requires (Dev)
- phpspec/phpspec: ~2.0
 - phpunit/phpunit: >=3.7,<5.0
 - symfony/http-foundation: ~2.0
 
This package is not auto-updated.
Last update: 2022-02-01 12:38:51 UTC
README
Simple input validation.
You'll no longer have to do the following:
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:
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:
composer require gnugat/ordono:~1.0
Further documentation
You can see the current and past versions using one of the following:
- the 
git tagcommand - the releases page on Github
 - the file listing the changes between versions
 
You can find more documentation at the following links:
- copyright and MIT license
 - versioning and branching models
 - contribution instructions
 - documentation directory