PropertyRequiredProcessor   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Library\DTO\Preparation\Processor\Property;
15
16
use Micro\Library\DTO\ClassDef\ClassDefinition;
17
use Micro\Library\DTO\ClassDef\PropertyDefinition;
18
use Micro\Library\DTO\Preparation\PreparationProcessorInterface;
19
20
class PropertyRequiredProcessor implements PropertyProcessorInterface
21
{
22 3
    public function process(PropertyDefinition $propertyDefinition, ClassDefinition $classDefinition, array $propertyData, array $classList): void
23
    {
24 3
        $required = 'true' === mb_strtolower($propertyData[PreparationProcessorInterface::PROP_REQUIRED] ?? 'false');
25
26 3
        $propertyDefinition->setIsRequired($required);
27
    }
28
}
29