DefaultValuesComponent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 11 3
1
<?php
2
/**
3
 * Copyright © Vaimo Group. All rights reserved.
4
 * See LICENSE_VAIMO.txt for license details.
5
 */
6
namespace Vaimo\ComposerPatches\Patch\Definition\NormalizerComponents;
7
8
use Vaimo\ComposerPatches\Patch\Definition as PatchDefinition;
9
10
class DefaultValuesComponent implements \Vaimo\ComposerPatches\Interfaces\DefinitionNormalizerComponentInterface
11
{
12
    public function normalize($target, $label, array $data, array $ownerConfig)
13
    {
14
        return array(
15
            PatchDefinition::PATH => isset($data[PatchDefinition::PATH]) && file_exists($data[PatchDefinition::PATH])
16
                ? $data[PatchDefinition::PATH]
17
                : '',
18
            PatchDefinition::STATUS_NEW => true,
19
            PatchDefinition::STATUS_CHANGED => true,
20
            PatchDefinition::STATUS_MATCH => false,
21
            PatchDefinition::STATUS_LABEL => '',
22
            PatchDefinition::CHECKSUM => ''
23
        );
24
    }
25
}
26