ValidationElement::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
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