Single::run()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 2
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
namespace GFG\Mapper\Data\Type;
4
5
/**
6
 * For single structures like:
7
 *
8
 * $data = [
9
 *     'brand' => 1
10
 * ];
11
 * $structure = [
12
 *     'brand' => [
13
 *         'type'   => 'single',
14
 *         'prefix' => 'brand'
15
 *     ]
16
 * ];
17
 */
18
class Single extends Base
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23 3
    public function run(&$data, $key = null)
24
    {
25 3
        $data = $this->get($key ?: $data);
26 3
    }
27
}
28