Completed
Pull Request — master (#48)
by Claudio
10:22 queued 04:51
created

TableMaskItem   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 1
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A supportedAttributeTypes() 0 4 1
A forRawValue() 0 8 1
1
<?php
2
3
namespace Flagbit\Bundle\TableAttributeBundle\Component\Product\Completeness\MaskItemGenerator;
4
5
use Akeneo\Pim\Enrichment\Component\Product\Completeness\MaskItemGenerator\MaskItemGeneratorForAttributeType;
6
use Flagbit\Bundle\TableAttributeBundle\AttributeType\TableType;
7
8
class TableMaskItem implements MaskItemGeneratorForAttributeType
9
{
10
    public function forRawValue(string $attributeCode, string $channelCode, string $localeCode, $value): array
11
    {
12
        return [
13
            sprintf(
14
                '%s-%s-%s',
15
                $attributeCode,
16
                $channelCode,
17
                $localeCode
18
            )
19
        ];
20
    }
21
22
    public function supportedAttributeTypes(): array
23
    {
24
        return [
25
            TableType::FLAGBIT_CATALOG_TABLE,
26
        ];
27
    }
28
}
29