Completed
Push — master ( c61969...df1bf5 )
by Marcus
02:35
created

ValidatorFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Mbright\Validation;
4
5
use Mbright\Validation\Failure\FailureCollection;
6
7
class ValidatorFactory
8
{
9
    /**
10
     * Get a new Failure Collection.
11
     *
12
     * @return FailureCollection
13
     */
14 57
    public function newFailureCollection(): FailureCollection
15
    {
16 57
        return new FailureCollection();
17
    }
18
19
    /**
20
     * Get a new Validator that's ready to use.
21
     *
22
     * @return Validator
23
     */
24 54
    public function newValidator(): Validator
25
    {
26 54
        return new Validator(
27 54
            $this->newFailureCollection()
28
        );
29
    }
30
}
31