Issues (146)

tests/TestOnly/MapperSkipper.php (2 issues)

Severity
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 MapperSkipper extends Extension implements TestOnly
13
{
14
    /**
15
     * @param string|\SilverStripe\ORM\DataObject $class
16
     * @param string $dbField
17
     * @param array $config
18
     * @param array $data
19
     * @return boolean
20
     */
21
    public function testSkip($class, $dbField, $config, $data)
0 ignored issues
show
The parameter $class 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

21
    public function testSkip(/** @scrutinizer ignore-unused */ $class, $dbField, $config, $data)

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...
The parameter $dbField 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

21
    public function testSkip($class, /** @scrutinizer ignore-unused */ $dbField, $config, $data)

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...
22
    {
23
        $salsifyField = $config['salsifyField'];
24
        if (array_key_exists($salsifyField, $data)) {
25
            return $data[$salsifyField] === '0';
26
        }
27
        return false;
28
    }
29
}
30