for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dynamic\Foxy\Test\TestOnly;
use Dynamic\Foxy\Model\Variation;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataExtension;
/**
* Class TestVariationDataExtension
* @package Dynamic\Foxy\Test\TestOnly
*/
class TestVariationDataExtension extends DataExtension implements TestOnly
{
* @var string[]
private static $has_one = [
$has_one
'Product' => TestProduct::class,
];
public static function get_extra_config($class = null, $extensionClass = null, $args = null)
$args
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
$extensionClass
public static function get_extra_config($class = null, /** @scrutinizer ignore-unused */ $extensionClass = null, $args = null)
$config = [];
// Only add these extensions if the $class is set to DataExtensionTest_Player, to
// test that the argument works.
if (strcasecmp($class, Variation::class) === 0) {
$config['has_one'] = [
}
return $config;