Passed
Push — master ( eb8b5a...80a24d )
by Nic
02:40
created

TestVariationDataExtension::get_extra_config()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 3
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Dynamic\Foxy\Test\TestOnly;
4
5
use Dynamic\Foxy\Model\Variation;
6
use SilverStripe\Dev\TestOnly;
7
use SilverStripe\ORM\DataExtension;
8
9
/**
10
 * Class TestVariationDataExtension
11
 * @package Dynamic\Foxy\Test\TestOnly
12
 */
13
class TestVariationDataExtension extends DataExtension implements TestOnly
14
{
15
    /**
16
     * @var string[]
17
     */
18
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
19
        'Product' => TestProduct::class,
20
    ];
21
22
    public static function get_extra_config($class = null, $extensionClass = null, $args = null)
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

22
    public static function get_extra_config($class = null, $extensionClass = null, /** @scrutinizer ignore-unused */ $args = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $extensionClass is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

22
    public static function get_extra_config($class = null, /** @scrutinizer ignore-unused */ $extensionClass = null, $args = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
    {
24
        $config = [];
25
26
        // Only add these extensions if the $class is set to DataExtensionTest_Player, to
27
        // test that the argument works.
28
        if (strcasecmp($class, Variation::class) === 0) {
29
            $config['has_one'] = [
30
                'Product' => TestProduct::class,
31
            ];
32
        }
33
34
        return $config;
35
    }
36
}
37