Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
Shapes
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 create
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 list
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 configure
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Cosray\Validation;
6
7use Celemas\Sire\Extra;
8use Celemas\Sire\Shape;
9
10final class Shapes
11{
12    public static function create(): Shape
13    {
14        return self::configure(new Shape());
15    }
16
17    public static function list(): Shape
18    {
19        return self::configure(Shape::list());
20    }
21
22    private static function configure(Shape $shape): Shape
23    {
24        return $shape
25            ->rules(Validators::registry())
26            ->extra(Extra::Allow);
27    }
28}