This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
11
{
12
const MACRO_METHOD = 'sortablePosition';
13
14
/**
15
* @var ExtensibleClassMetadata
16
*/
17
protected $classMetadata;
18
19
/**
20
* @var string
21
*/
22
protected $fieldName;
23
24
/**
25
* @param ExtensibleClassMetadata $classMetadata
26
* @param string $fieldName
27
*/
28
2
public function __construct(ExtensibleClassMetadata $classMetadata, $fieldName)
29
{
30
2
$this->classMetadata = $classMetadata;
31
2
$this->fieldName = $fieldName;
32
2
}
33
34
/**
35
* Return the name of the actual extension.
36
*
37
* @return string
38
*/
39
1
public function getExtensionName()
40
{
41
1
return FluentDriver::EXTENSION_NAME;
42
}
43
44
/**
45
* @return void
46
*/
47
public static function enable()
48
{
49
2
Field::macro(self::MACRO_METHOD, function (Field $builder) {
50
1
return new static($builder->getClassMetadata(), $builder->getName());
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.