| Total Lines | 71 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| 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 |
||
| 195 | private function mockRequest(): RequestInterface |
||
| 196 | { |
||
| 197 | $c = new class($this) implements RequestInterface |
||
| 198 | { |
||
| 199 | private $unitTestInstance; |
||
| 200 | public function __construct(EmbedContainerTest $unitTestInstance) |
||
| 201 | { |
||
| 202 | $this->unitTestInstance = $unitTestInstance; |
||
| 203 | } |
||
| 204 | public function getRequestTarget() |
||
| 205 | { |
||
| 206 | } |
||
| 207 | public function withRequestTarget($requestTarget) |
||
| 208 | { |
||
| 209 | return $this; |
||
| 210 | } |
||
| 211 | public function getMethod() |
||
| 212 | { |
||
| 213 | } |
||
| 214 | public function withMethod($method) |
||
| 215 | { |
||
| 216 | } |
||
| 217 | public function getUri() |
||
| 218 | { |
||
| 219 | $this->unitTestInstance->firstRequest = false; |
||
| 220 | return $this->unitTestInstance->mockUri(); |
||
| 221 | } |
||
| 222 | public function withUri(UriInterface $uri, $preserveHost = false) |
||
| 223 | { |
||
| 224 | return $this; |
||
| 225 | } |
||
| 226 | public function getProtocolVersion() |
||
| 227 | { |
||
| 228 | } |
||
| 229 | public function withProtocolVersion($version) |
||
| 230 | { |
||
| 231 | return $this; |
||
| 232 | } |
||
| 233 | public function getHeaders() |
||
| 234 | { |
||
| 235 | } |
||
| 236 | public function hasHeader($name) |
||
| 237 | { |
||
| 238 | } |
||
| 239 | public function getHeader($name) |
||
| 240 | { |
||
| 241 | } |
||
| 242 | public function getHeaderLine($name) |
||
| 243 | { |
||
| 244 | } |
||
| 245 | public function withHeader($name, $value) |
||
| 246 | { |
||
| 247 | return $this; |
||
| 248 | } |
||
| 249 | public function withAddedHeader($name, $value) |
||
| 250 | { |
||
| 251 | return $this; |
||
| 252 | } |
||
| 253 | public function withoutHeader($name) |
||
| 254 | { |
||
| 255 | return $this; |
||
| 256 | } |
||
| 257 | public function getBody() |
||
| 258 | { |
||
| 259 | } |
||
| 260 | public function withBody(StreamInterface $body) |
||
| 261 | { |
||
| 262 | return $this; |
||
| 263 | } |
||
| 264 | }; |
||
| 265 | return new $c($this); |
||
| 266 | } |
||
| 268 |
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