Option   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 3
c 2
b 1
f 1
lcom 0
cbo 1
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 3
1
<?php
2
3
namespace GFG\Mapper\Data\Type;
4
5
/**
6
 * For option-like structures like:
7
 *
8
 * $data = [
9
 *     'myOptions' => [1, 2, 3, 4]
10
 * ];
11
 * $structure = [
12
 *     'myOptions' => [
13
 *         'type'   => 'option',
14
 *         'prefix' => 'my_options'
15
 *     ]
16
 * ];
17
 */
18
class Option extends Base
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23 3
    public function run(&$data, $key = null)
24
    {
25 3
        foreach ($data as &$value) {
26 3
            $value = $this->get($key ? "{$key}_{$value}" : $value);
27 3
        }
28 3
    }
29
}
30