PHP code example of qlimix / validation

1. Go to this page and download the library: Download qlimix/validation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

qlimix / validation example snippets




use Qlimix\Validation\CollectionValidation;
use Qlimix\Validation\Inspector\HashInspector;
use Qlimix\Validation\Inspector\KeyInspector;
use Qlimix\Validation\Key;

$example1 = new CollectionValidation([
    new HashInspector([new Key('foo', true, [])]), // add validators
    new KeyInspector('foobar', true, [
        new HashInspector([
            new Key('bar', true, []), // add validators
            new Key('foo', true, []), // add validators
        ])
    ])
]);



use Qlimix\Validation\Inspector\HashInspector;
use Qlimix\Validation\Inspector\KeyInspector;
use Qlimix\Validation\InspectorValidation;
use Qlimix\Validation\Key;

$example2 = new InspectorValidation([
    new HashInspector([new Key('foo', true, [])]), // add validators
    new KeyInspector('foobar', true, [
        new HashInspector([
            new Key('bar', true, []), // add validators
            new Key('bar', true, []), // add validators
        ])
    ])
]);