2017 © Pedro Peláez
 

library validate

phramework's validation library

image

phramework/validate

phramework's validation library

  • Thursday, May 17, 2018
  • by nohponex
  • Repository
  • 4 Watchers
  • 3 Stars
  • 9,582 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 1 Forks
  • 16 Open issues
  • 40 Versions
  • 8 % Grown

The README.md

phramework/validate

phramework's validation library https://phramework.github.io/validate/, (*1)

Coverage Status Build Status StyleCI Stories in Ready, (*2)

Usage

Require package using composer, (*3)

composer require phramework/validate

Parse an integer value

require './vendor/autoload.php';

use \Phramework\Validate\IntegerValidator;

$validationModel = new IntegerValidator(-1, 1);

$value = $validationModel->parse('0');

var_dump($value);

The above example will output:, (*4)

int(0)

Parse an object of strings

$validationModel = new ObjectValidator(
    (object) [
        'name' => new StringValidator(2, 30),
        'city' => new StringValidator(2, 30)
    ],
    ['name', 'city'], //required properties
    false //no additional properties allowed
);

$value = $validationModel->parse((object) [
    'name' => 'Xenofon',
    'city' => 'Thessaloniki'
]);

print_r($value);

The above example will output:, (*5)

stdClass Object
(
    [name] => Xenofon
    [city] => Thessaloniki
)

Check wiki for more examples., (*6)

Development

Install dependencies

composer update

Test and lint code

composer test
composer lint

License

Copyright 2015 - 2016 Xenofon Spafaridis, (*7)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at, (*8)

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License., (*9)

The Versions

17/05 2018

dev-xs-update-composer-dependencies

dev-xs-update-composer-dependencies https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

24/10 2017
24/10 2017

dev-1.x-fix-uniqueItems

dev-1.x-fix-uniqueItems https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

24/10 2017
24/10 2017

dev-xs-fix-uniqueItems

dev-xs-fix-uniqueItems https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

23/03 2017

dev-0.x-extended-x-visibility

dev-0.x-extended-x-visibility https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

25/05 2016
23/05 2016
22/05 2016
21/05 2016

dev-dev-x-visibility

dev-dev-x-visibility https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

27/03 2016
01/01 2016
31/12 2015
13/12 2015

0.1.1

0.1.1.0 https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

10/12 2015

0.1.0

0.1.0.0 https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

28/11 2015

0.0.0

0.0.0.0 https://phramework.github.io/

phramework's validation library

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires