Conditions | 1 |
Paths | 1 |
Total Lines | 63 |
Code Lines | 43 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
45 | protected function buildTcaArray(): array |
||
46 | { |
||
47 | return [ |
||
48 | 'ctrl' => $this->getDefaultCtrl(), |
||
49 | |||
50 | 'palettes' => [ |
||
51 | 'content' => [ |
||
52 | 'showitem' => 'message,markers', |
||
53 | 'canNotCollapse' => true, |
||
54 | ], |
||
55 | 'levels' => [ |
||
56 | 'showitem' => 'level,levels_descriptions', |
||
57 | 'canNotCollapse' => true, |
||
58 | ], |
||
59 | ], |
||
60 | |||
61 | 'types' => [ |
||
62 | '0' => [ |
||
63 | 'showitem' => ' |
||
64 | error_message, |
||
65 | title, description, hidden, |
||
66 | --div--;' . self::LLL . ':tab.event, |
||
67 | event, event_configuration_flex, |
||
68 | --div--;' . self::LLL . ':tab.channel, |
||
69 | channel, |
||
70 | --div--;' . self::LOG_LLL . ':tab.log, |
||
71 | --palette--;' . self::LOG_LLL . ':palette.content;content, |
||
72 | --palette--;' . self::LOG_LLL . ':palette.levels;levels', |
||
73 | ], |
||
74 | ], |
||
75 | |||
76 | 'columns' => [ |
||
77 | 'message' => [ |
||
78 | 'exclude' => 1, |
||
79 | 'label' => self::LOG_LLL . ':field.message', |
||
80 | 'config' => [ |
||
81 | 'type' => 'input', |
||
82 | 'default' => '', |
||
83 | 'size' => 255, |
||
84 | 'eval' => 'trim,required', |
||
85 | ], |
||
86 | ], |
||
87 | |||
88 | 'level' => [ |
||
89 | 'exclude' => 1, |
||
90 | 'label' => self::LOG_LLL . ':field.level', |
||
91 | 'l10n_mode' => 'exclude', |
||
92 | 'l10n_display' => 'defaultAsReadonly', |
||
93 | 'config' => [ |
||
94 | 'type' => 'radio', |
||
95 | 'items' => [], |
||
96 | 'itemsProcFunc' => EntityLogTcaService::class . '->getLogLevelsList', |
||
97 | 'eval' => 'required', |
||
98 | ], |
||
99 | ], |
||
100 | |||
101 | 'levels_descriptions' => [ |
||
102 | 'exclude' => 1, |
||
103 | 'label' => self::LOG_LLL . ':field.levels_descriptions_title', |
||
104 | 'l10n_display' => 'defaultAsReadonly', |
||
105 | 'config' => [ |
||
106 | 'type' => 'user', |
||
107 | 'userFunc' => EntityLogTcaService::class . '->getLogLevelsDescriptions', |
||
108 | ], |
||
123 |