Passed
Pull Request — master (#18)
by Matthew
02:12
created

MapperModification   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testModification() 0 7 2
1
<?php
2
3
namespace Dynamic\Salsify\Tests\TestOnly;
4
5
use SilverStripe\Core\Extension;
6
use SilverStripe\Dev\TestOnly;
7
8
/**
9
 * Class MapperModification
10
 * @package Dynamic\Salsify\Tests\TestOnly
11
 */
12
class MapperModification extends Extension implements TestOnly
13
{
14
    /**
15
     * @param string $dbField
16
     * @param array $config
17
     * @param array $data
18
     * @return array
19
     */
20
    public function testModification($dbField, $config, $data)
21
    {
22
        $salsifyField = $config['salsifyField'];
23
        if (array_key_exists($salsifyField, $data)) {
24
            $data[$salsifyField] = $data[$salsifyField] . ' TEST_MOD';
25
        }
26
        return $data;
27
    }
28
}
29