2017 © Pedro Peláez
 

library chubbyphp-validation-model

Chubbyphp Deserialize

image

chubbyphp/chubbyphp-validation-model

Chubbyphp Deserialize

  • Saturday, July 28, 2018
  • by dominikzogg
  • Repository
  • 0 Watchers
  • 0 Stars
  • 325 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 49 Versions
  • 0 % Grown

The README.md

chubbyphp-validation

CI Coverage Status Mutation testing badge Latest Stable Version Total Downloads Monthly Downloads, (*1)

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities, (*2)

Description

A simple validation., (*3)

DEPRECATED: No personal interest anymore and based on stats nobody seems to use it. Feel free to create an issue if you disagree. Please take a look to chubbyphp-parsing its a different concept. But i believe parsing is the way to go instead of deserialze/validate., (*4)

Requirements

  • php: ^8.1
  • psr/log: ^2.0|^3.0

Suggest

  • chubbyphp/chubbyphp-container: ^2.2
  • pimple/pimple: ^3.5
  • psr/container: ^2.0.2

Installation

Through Composer as chubbyphp/chubbyphp-validation., (*5)

composer require chubbyphp/chubbyphp-validation "^4.0"

Usage

Accessor

Constraint

  • [AllConstraint][101]
  • [BlankConstraint][102]
  • [CallbackConstraint][103]
  • [ChoiceConstraint][104]
  • [CoordinateArrayConstraint][105]
  • [CoordinateConstraint][106]
  • [CountConstraint][107]
  • [DateTimeConstraint][108]
  • [EmailConstraint][109]
  • [FalseConstraint][110]
  • [MapConstraint][111]
  • [NotBlankConstraint][112]
  • [NotNullConstraint][113]
  • [NullConstraint][114]
  • [NumericConstraint][115]
  • [NumericRangeConstraint][116]
  • [TrueConstraint][117]
  • [TypeConstraint][118]
  • [ValidConstraint][119]

Doctrine

  • [UniqueConstraint][120]

Symfony

  • [ConstraintAdapter][121]

Error

Mapping

ValidationMappingProvider

<?php

namespace MyProject\Model;

final class Model
{
    /**
     * @var array<\DateTime>
     */
    private $dates;
}
<?php

namespace MyProject\Mapping\Validation;

use Chubbyphp\Validation\Constraint\AllConstraint;
use Chubbyphp\Validation\Constraint\DateTimeConstraint;
use Chubbyphp\Validation\Constraint\NotBlankConstraint;
use Chubbyphp\Validation\Constraint\NotNullConstraint;
use Chubbyphp\Validation\Mapping\ValidationClassMappingBuilder;
use Chubbyphp\Validation\Mapping\ValidationClassMappingInterface;
use Chubbyphp\Validation\Mapping\ValidationMappingProviderInterface;
use Chubbyphp\Validation\Mapping\ValidationPropertyMappingBuilder;
use Chubbyphp\Validation\Mapping\ValidationPropertyMappingInterface;
use MyProject\Model\Model;

final class ModelValidationMappingProvider implements ValidationMappingProviderInterface
{
    /**
     * @return string
     */
    public function getClass(): string
    {
        return Model::class;
    }

    /**
     * @param string $path
     *
     * @return ValidationClassMappingInterface
     */
    public function getValidationClassMapping(string $path): ValidationClassMappingInterface
    {
        return ValidationClassMappingBuilder::create([])->getMapping();
    }

    /**
     * @param string      $path
     * @param string|null $type
     *
     * @return ValidationPropertyMappingInterface[]
     */
    public function getValidationPropertyMappings(string $path, string $type = null): array
    {
        return [
            ValidationPropertyMappingBuilder::create('dates', [
                new AllConstraint([
                    new NotNullConstraint(),
                    new NotBlankConstraint(),
                    new DateTimeConstraint('d.m.Y'),
                ]),
            ])->getMapping(),
        ];
    }
}

ServiceFactory

chubbyphp-container

chubbyphp-laminas-config-factory

ServiceProvider

Validator

<?php

namespace MyProject;

use Chubbyphp\Validation\Mapping\ValidationMappingProviderRegistry;
use Chubbyphp\Validation\ValidatorContextInterface;
use Chubbyphp\Validation\Validator;
use MyProject\Mapping\Validation\ModelValidationMappingProvider;
use MyProject\Model\Model;

$logger = ...;

$validator = new Validator(
    new ValidationMappingProviderRegistry([
        new ModelValidationMappingProvider()
    ]),
    $logger
);

$model = new Model;

/** @var ValidatorContextInterface $context */
$context = ...;

$errors = $validator->validate(
    $model,
    $context
);

2024 Dominik Zogg, (*6)

The Versions

28/07 2018

dev-use-chubbyphp-mock

dev-use-chubbyphp-mock

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

30/06 2018

dev-master

9999999-dev

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

30/06 2018

3.1.0

3.1.0.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

27/06 2018

3.0.2

3.0.2.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

05/06 2018

3.0.1

3.0.1.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

01/06 2018

3.0.0

3.0.0.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

01/06 2018

3.0-beta2

3.0.0.0-beta2

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/05 2018

3.0-beta1

3.0.0.0-beta1

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/05 2018

dev-prepare-v3

dev-prepare-v3

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

22/04 2018

v2.x-dev

2.9999999.9999999.9999999-dev

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

22/04 2018

2.2.0

2.2.0.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

26/10 2017

2.1.1

2.1.1.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

22/08 2017

2.1.0

2.1.0.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

21/08 2017

2.1-beta1

2.1.0.0-beta1

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/07 2017

2.0.3

2.0.3.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/07 2017

2.0.2

2.0.2.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/07 2017

2.0.1

2.0.1.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/07 2017

2.0.0

2.0.0.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/07 2017

2.0-alpha14

2.0.0.0-alpha14

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/07 2017

2.0-alpha13

2.0.0.0-alpha13

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/07 2017

2.0-alpha12

2.0.0.0-alpha12

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/07 2017

2.0-alpha11

2.0.0.0-alpha11

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/07 2017

2.0-alpha10

2.0.0.0-alpha10

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

05/05 2017

1.0-alpha3

1.0.0.0-alpha3

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

05/05 2017

2.0-alpha9

2.0.0.0-alpha9

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

01/05 2017

2.0-alpha8

2.0.0.0-alpha8

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

23/04 2017

2.0-alpha7

2.0.0.0-alpha7

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

23/04 2017

1.0-alpha2

1.0.0.0-alpha2

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

23/04 2017

1.0-alpha1

1.0.0.0-alpha1

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

23/04 2017

2.0-alpha6

2.0.0.0-alpha6

Chubbyphp Validation

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

22/04 2017

2.0-alpha5

2.0.0.0-alpha5

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

22/04 2017

2.0-alpha4

2.0.0.0-alpha4

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

21/04 2017

2.0-alpha3

2.0.0.0-alpha3

Chubbyphp Validation

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

21/04 2017

2.0-alpha2

2.0.0.0-alpha2

Chubbyphp Validation

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

20/04 2017

2.0-alpha1

2.0.0.0-alpha1

Chubbyphp Validation

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/03 2017

v1.x-dev

1.9999999.9999999.9999999-dev

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

25/03 2017

1.0.9

1.0.9.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

16/03 2017

1.0.8

1.0.8.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

06/03 2017

1.0.7

1.0.7.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

21/12 2016

1.0.6

1.0.6.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

17/12 2016

1.0.5

1.0.5.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

06/12 2016

1.0.4

1.0.4.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

28/11 2016

1.0.3

1.0.3.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

13/11 2016

1.0.2

1.0.2.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

26/10 2016

1.0.1

1.0.1.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

25/10 2016

1.0.0

1.0.0.0

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation model slim chubbyphp

18/10 2016

1.0.0-beta2

1.0.0.0-beta2

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

16/10 2016

1.0.0-beta1

1.0.0.0-beta1

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp

03/10 2016

1.0.0-alpha1

1.0.0.0-alpha1

Chubbyphp Validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

validation slim chubbyphp