Conditions | 10 |
Paths | 10 |
Total Lines | 47 |
Code Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
109 | private function getWhoopsInstance(ServerRequestInterface $request) |
||
110 | { |
||
111 | if ($this->whoops) { |
||
112 | return $this->whoops; |
||
113 | } |
||
114 | |||
115 | $whoops = new Run(); |
||
116 | |||
117 | if (php_sapi_name() === 'cli') { |
||
118 | $whoops->pushHandler(new PlainTextHandler()); |
||
119 | |||
120 | return $whoops; |
||
121 | } |
||
122 | |||
123 | $format = FormatNegotiator::getFormat($request); |
||
124 | |||
125 | switch ($format) { |
||
126 | case 'json': |
||
127 | $whoops->pushHandler(new JsonResponseHandler()); |
||
128 | break; |
||
129 | |||
130 | case 'html': |
||
131 | $whoops->pushHandler(new PrettyPageHandler()); |
||
132 | break; |
||
133 | |||
134 | case 'xml': |
||
135 | $whoops->pushHandler(new XmlResponseHandler()); |
||
136 | break; |
||
137 | |||
138 | case 'txt': |
||
139 | case 'css': |
||
140 | case 'js': |
||
141 | $whoops->pushHandler(new PlainTextHandler()); |
||
142 | break; |
||
143 | |||
144 | default: |
||
145 | if (empty($format)) { |
||
146 | $whoops->pushHandler(new PrettyPageHandler()); |
||
147 | } else { |
||
148 | $whoops->pushHandler(new PlainTextHandler()); |
||
149 | } |
||
150 | |||
151 | break; |
||
152 | } |
||
153 | |||
154 | return $whoops; |
||
155 | } |
||
156 | } |
||
157 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.