ValidationElement   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
/**
3
 * @author    Nurlan Mukhanov <[email protected]>
4
 * @copyright 2022 Nurlan Mukhanov
5
 * @license   https://en.wikipedia.org/wiki/MIT_License MIT License
6
 * @link      https://github.com/Falseclock/service-layer
7
 */
8
9
declare(strict_types=1);
10
11
namespace Falseclock\Service\Validation;
12
13
use Closure;
14
15
final class ValidationElement
16
{
17
    /** @var Validator $validator */
18
    public $validator;
19
    /** @var scalar|callable|Closure $valueOrEnclosure */
20
    public $valueOrEnclosure;
21
22
    /**
23
     * ValidationElement constructor.
24
     *
25
     * @param scalar|callable|Closure $valueOrEnclosure
26
     * @param Validator $validator
27
     */
28
    public function __construct($valueOrEnclosure, Validator $validator)
29
    {
30
        $this->valueOrEnclosure = $valueOrEnclosure;
31
        $this->validator = $validator;
32
    }
33
}
34