Conditions | 1 |
Paths | 1 |
Total Lines | 104 |
Code Lines | 62 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
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 |
||
50 | public function getFunctions(): array |
||
51 | { |
||
52 | return [ |
||
53 | new Twig_SimpleFunction(self::FUNCTION_GET_PUBLIC_FOLDER_PATH, function ($relativePath) { |
||
54 | $publicFolderPath = $this->getPublicFolderPath(); |
||
55 | return $publicFolderPath . $relativePath; |
||
56 | }, [ |
||
57 | $this, |
||
58 | self::FUNCTION_GET_PUBLIC_FOLDER_PATH, |
||
59 | ]), |
||
60 | |||
61 | new Twig_SimpleFunction(self::FUNCTION_GET_QA_ATTRIBUTE, function (array $qaValues = []) { |
||
62 | return $this->getQaAttribute($qaValues); |
||
63 | }, [ |
||
64 | $this, |
||
65 | self::FUNCTION_GET_QA_ATTRIBUTE, |
||
66 | 'is_safe' => ['html'], |
||
67 | 'is_variadic' => true, |
||
68 | ]), |
||
69 | |||
70 | new Twig_SimpleFunction(self::FUNCTION_GET_QA_ATTRIBUTE_SUB, function ($qaName, array $qaValues = []) { |
||
71 | return $this->getQaAttribute($qaValues, $qaName); |
||
72 | }, [ |
||
73 | $this, |
||
74 | self::FUNCTION_GET_QA_ATTRIBUTE_SUB, |
||
75 | 'is_safe' => ['html'], |
||
76 | 'is_variadic' => true, |
||
77 | ]), |
||
78 | |||
79 | new Twig_SimpleFunction(self::FUNCTION_GET_UI_MODEL_COMPONENT_TEMPLATE, function ($modelName) { |
||
80 | return $this->getModelTemplate($modelName); |
||
81 | }, [ |
||
82 | $this, |
||
83 | self::FUNCTION_GET_UI_MODEL_COMPONENT_TEMPLATE, |
||
84 | ]), |
||
85 | |||
86 | new Twig_SimpleFunction(self::FUNCTION_GET_UI_ATOM_COMPONENT_TEMPLATE, function ($componentName, $componentModule = self::DEFAULT_MODULE) { |
||
87 | return $this->getComponentTemplate($componentModule, 'atoms', $componentName); |
||
88 | }, [ |
||
89 | $this, |
||
90 | self::FUNCTION_GET_UI_ATOM_COMPONENT_TEMPLATE, |
||
91 | ]), |
||
92 | |||
93 | new Twig_SimpleFunction(self::FUNCTION_GET_UI_MOLECULE_COMPONENT_TEMPLATE, function ($componentName, $componentModule = self::DEFAULT_MODULE) { |
||
94 | return $this->getComponentTemplate($componentModule, 'molecules', $componentName); |
||
95 | }, [ |
||
96 | $this, |
||
97 | self::FUNCTION_GET_UI_MOLECULE_COMPONENT_TEMPLATE, |
||
98 | ]), |
||
99 | |||
100 | new Twig_SimpleFunction(self::FUNCTION_GET_UI_ORGANISM_COMPONENT_TEMPLATE, function ($componentName, $componentModule = self::DEFAULT_MODULE) { |
||
101 | return $this->getComponentTemplate($componentModule, 'organisms', $componentName); |
||
102 | }, [ |
||
103 | $this, |
||
104 | self::FUNCTION_GET_UI_ORGANISM_COMPONENT_TEMPLATE, |
||
105 | ]), |
||
106 | |||
107 | new Twig_SimpleFunction(self::FUNCTION_GET_UI_TEMPLATE_COMPONENT_TEMPLATE, function ($templateName, $templateModule = self::DEFAULT_MODULE) { |
||
108 | return $this->getTemplateTemplate($templateModule, $templateName); |
||
109 | }, [ |
||
110 | $this, |
||
111 | self::FUNCTION_GET_UI_TEMPLATE_COMPONENT_TEMPLATE, |
||
112 | ]), |
||
113 | |||
114 | new Twig_SimpleFunction(self::FUNCTION_GET_UI_VIEW_COMPONENT_TEMPLATE, function ($viewName, $viewModule = self::DEFAULT_MODULE) { |
||
115 | return $this->getViewTemplate($viewModule, $viewName); |
||
116 | }, [ |
||
117 | $this, |
||
118 | self::FUNCTION_GET_UI_VIEW_COMPONENT_TEMPLATE, |
||
119 | ]), |
||
120 | |||
121 | new Twig_SimpleFunction('widget', function () { |
||
122 | return null; |
||
123 | }, [ |
||
124 | $this, |
||
125 | 'widget', |
||
126 | ]), |
||
127 | |||
128 | new Twig_SimpleFunction('widgetBlock', function () { |
||
129 | return null; |
||
130 | }, [ |
||
131 | $this, |
||
132 | 'widgetBlock', |
||
133 | ]), |
||
134 | |||
135 | new Twig_SimpleFunction('widgetGlobal', function () { |
||
136 | return null; |
||
137 | }, [ |
||
138 | $this, |
||
139 | 'widgetGlobal', |
||
140 | ]), |
||
141 | |||
142 | new Twig_SimpleFunction('widgetExists', function () { |
||
143 | return false; |
||
144 | }, [ |
||
145 | $this, |
||
146 | 'widgetExists', |
||
147 | ]), |
||
148 | |||
149 | new Twig_SimpleFunction('widgetGlobalExists', function () { |
||
150 | return false; |
||
151 | }, [ |
||
152 | $this, |
||
153 | 'widgetGlobalExists', |
||
154 | ]), |
||
247 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths