for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dynamic\Salsify\Tests\TestOnly;
use SilverStripe\Core\Extension;
use SilverStripe\Dev\TestOnly;
/**
* Class MapperModification
* @package Dynamic\Salsify\Tests\TestOnly
*/
class MapperSkipper extends Extension implements TestOnly
{
* @param string|\SilverStripe\ORM\DataObject $class
* @param string $dbField
* @param array $config
* @param array $data
* @return boolean
public function testSkip($class, $dbField, $config, $data)
$class
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
$dbField
public function testSkip($class, /** @scrutinizer ignore-unused */ $dbField, $config, $data)
$salsifyField = $config['salsifyField'];
if (array_key_exists($salsifyField, $data)) {
return $data[$salsifyField] === '0';
}
return false;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.