Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Lines | 8 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
30 | View Code Duplication | public static function mandatoryToField(string $class): self |
|
31 | { |
||
32 | return new static( |
||
33 | 'The model '.$class.' uses the HasSlug trait'.PHP_EOL. |
||
34 | 'You are required to set the field where to store the generated slug ($toField)'.PHP_EOL. |
||
35 | 'You can do this from inside the getSlugOptions() method defined on the model.' |
||
36 | ); |
||
37 | } |
||
38 | } |
||
39 |
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.