| Conditions | 1 |
| Total Lines | 58 |
| 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 |
||
| 42 | private function getUri(): UriInterface |
||
| 43 | { |
||
| 44 | $c = new class implements UriInterface |
||
| 45 | { |
||
| 46 | public function getScheme() |
||
| 47 | { |
||
| 48 | return 'https'; |
||
| 49 | } |
||
| 50 | public function getHost() |
||
| 51 | { |
||
| 52 | return 'youtube.com'; |
||
| 53 | } |
||
| 54 | public function getPath() |
||
| 55 | { |
||
| 56 | return '/watch?v=iRXJXaLV0n4'; |
||
| 57 | } |
||
| 58 | public function __toString() |
||
| 59 | { |
||
| 60 | return ''; |
||
| 61 | } |
||
| 62 | public function getAuthority() |
||
| 63 | { |
||
| 64 | } |
||
| 65 | public function getUserInfo() |
||
| 66 | { |
||
| 67 | } |
||
| 68 | public function getPort() |
||
| 69 | { |
||
| 70 | } |
||
| 71 | public function getQuery() |
||
| 72 | { |
||
| 73 | } |
||
| 74 | public function getFragment() |
||
| 75 | { |
||
| 76 | } |
||
| 77 | public function withScheme($scheme) |
||
| 78 | { |
||
| 79 | } |
||
| 80 | public function withUserInfo($user, $password = null) |
||
| 81 | { |
||
| 82 | } |
||
| 83 | public function withHost($host) |
||
| 84 | { |
||
| 85 | } |
||
| 86 | public function withPort($port) |
||
| 87 | { |
||
| 88 | } |
||
| 89 | public function withPath($path) |
||
| 90 | { |
||
| 91 | } |
||
| 92 | public function withQuery($query) |
||
| 93 | { |
||
| 94 | } |
||
| 95 | public function withFragment($fragment) |
||
| 96 | { |
||
| 97 | } |
||
| 98 | }; |
||
| 99 | return new $c(); |
||
| 100 | } |
||
| 169 |
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