Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Latest commit

 

History

History
24 lines (18 loc) · 461 Bytes

ValidationServiceProvider.md

File metadata and controls

24 lines (18 loc) · 461 Bytes

ValidationServiceProvider

<?php

use Chubbyphp\Validation\ServiceProvider\ValidationServiceProvider;
use Chubbyphp\Validation\ValidatorContextInterface;
use Pimple\Container;

$container = new Container();
$container->register(new ValidationServiceProvider);

$object = ...;

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

$errors = $container['validator']
    ->validate(
        $object,
        $context,
        'path'
    );