These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Itstructure\FieldWidgets; |
||
4 | |||
5 | use Itstructure\CKEditor\CKEditor; |
||
6 | |||
7 | /** |
||
8 | * Class FieldTypeCKEditor |
||
9 | * Class for printing a CKEditor. |
||
10 | * |
||
11 | * @package Itstructure\FieldWidgets |
||
12 | */ |
||
13 | View Code Duplication | class FieldTypeCKEditor extends FieldType |
|
0 ignored issues
–
show
|
|||
14 | { |
||
15 | /** |
||
16 | * @return string |
||
17 | */ |
||
18 | public function run(): string |
||
19 | { |
||
20 | return $this->getField() |
||
21 | ->widget( |
||
22 | CKEditor::class, |
||
23 | [ |
||
24 | 'preset' => $this->preset, |
||
25 | 'clientOptions' => $this->getOptions() |
||
26 | ] |
||
27 | ) |
||
28 | ->label($this->getLabel()); |
||
29 | } |
||
30 | } |
||
31 |
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.