| Conditions | 1 |
| Paths | 1 |
| Total Lines | 60 |
| 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 |
||
| 16 | public function matchProvider(): array |
||
| 17 | { |
||
| 18 | return [ |
||
| 19 | [SimplifiedRequest::fromUrl('http://example.com'), 'fifth_sa'], |
||
| 20 | [SimplifiedRequest::fromUrl('https://example.com'), 'fourth_sa'], |
||
| 21 | [SimplifiedRequest::fromUrl('http://example.com/'), 'fifth_sa'], |
||
| 22 | [SimplifiedRequest::fromUrl('https://example.com/'), 'fourth_sa'], |
||
| 23 | [SimplifiedRequest::fromUrl('http://example.com//'), 'fifth_sa'], |
||
| 24 | [SimplifiedRequest::fromUrl('https://example.com//'), 'fourth_sa'], |
||
| 25 | [SimplifiedRequest::fromUrl('http://example.com:8080/'), 'default_sa'], |
||
| 26 | [SimplifiedRequest::fromUrl('http://example.com/first_siteaccess/'), 'fifth_sa'], |
||
| 27 | [SimplifiedRequest::fromUrl('http://example.com/?first_siteaccess'), 'fifth_sa'], |
||
| 28 | [SimplifiedRequest::fromUrl('http://example.com/?first_sa'), 'fifth_sa'], |
||
| 29 | [SimplifiedRequest::fromUrl('http://example.com/first_salt'), 'fifth_sa'], |
||
| 30 | [SimplifiedRequest::fromUrl('http://example.com/first_sa.foo'), 'fifth_sa'], |
||
| 31 | [SimplifiedRequest::fromUrl('http://example.com/test'), 'fifth_sa'], |
||
| 32 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/'), 'fifth_sa'], |
||
| 33 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/'), 'fifth_sa'], |
||
| 34 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/first_sa'), 'fifth_sa'], |
||
| 35 | [SimplifiedRequest::fromUrl('http://example.com/default_sa'), 'fifth_sa'], |
||
| 36 | |||
| 37 | [SimplifiedRequest::fromUrl('http://example.com/first_sa'), 'first_sa'], |
||
| 38 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/'), 'first_sa'], |
||
| 39 | // Shouldn't match "first_sa" because of double slash |
||
| 40 | [SimplifiedRequest::fromUrl('http://example.com//first_sa/'), 'fifth_sa'], |
||
| 41 | [SimplifiedRequest::fromUrl('http://example.com/first_sa//'), 'first_sa'], |
||
| 42 | [SimplifiedRequest::fromUrl('http://example.com/first_sa///test'), 'first_sa'], |
||
| 43 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/foo'), 'first_sa'], |
||
| 44 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/foo/bar'), 'first_sa'], |
||
| 45 | [SimplifiedRequest::fromUrl('http://example.com:82/first_sa/'), 'first_sa'], |
||
| 46 | [SimplifiedRequest::fromUrl('http://third_siteaccess/first_sa/'), 'first_sa'], |
||
| 47 | [SimplifiedRequest::fromUrl('http://first_sa/'), 'first_sa'], |
||
| 48 | [SimplifiedRequest::fromUrl('https://first_sa/'), 'first_sa'], |
||
| 49 | [SimplifiedRequest::fromUrl('http://first_sa:81/'), 'first_sa'], |
||
| 50 | [SimplifiedRequest::fromUrl('http://first_siteaccess/'), 'first_sa'], |
||
| 51 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/'), 'first_sa'], |
||
| 52 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/'), 'first_sa'], |
||
| 53 | [SimplifiedRequest::fromUrl('http://first_siteaccess/foo/'), 'first_sa'], |
||
| 54 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/foo/'), 'first_sa'], |
||
| 55 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/foo/'), 'first_sa'], |
||
| 56 | |||
| 57 | [SimplifiedRequest::fromUrl('http://example.com/second_sa'), 'second_sa'], |
||
| 58 | [SimplifiedRequest::fromUrl('http://example.com/second_sa/'), 'second_sa'], |
||
| 59 | [SimplifiedRequest::fromUrl('http://example.com/second_sa?param1=foo'), 'second_sa'], |
||
| 60 | [SimplifiedRequest::fromUrl('http://example.com/second_sa/foo/'), 'second_sa'], |
||
| 61 | [SimplifiedRequest::fromUrl('http://example.com:82/second_sa/'), 'second_sa'], |
||
| 62 | [SimplifiedRequest::fromUrl('http://example.com:83/second_sa/'), 'second_sa'], |
||
| 63 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/second_sa/'), 'second_sa'], |
||
| 64 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/second_sa/'), 'second_sa'], |
||
| 65 | |||
| 66 | [SimplifiedRequest::fromUrl('http://example.com:81/'), 'third_sa'], |
||
| 67 | [SimplifiedRequest::fromUrl('https://example.com:81/'), 'third_sa'], |
||
| 68 | [SimplifiedRequest::fromUrl('http://example.com:81/foo'), 'third_sa'], |
||
| 69 | [SimplifiedRequest::fromUrl('http://example.com:81/foo/bar'), 'third_sa'], |
||
| 70 | |||
| 71 | [SimplifiedRequest::fromUrl('http://example.com:82/'), 'fourth_sa'], |
||
| 72 | [SimplifiedRequest::fromUrl('https://example.com:82/'), 'fourth_sa'], |
||
| 73 | [SimplifiedRequest::fromUrl('https://example.com:82/foo'), 'fourth_sa'], |
||
| 74 | ]; |
||
| 75 | } |
||
| 76 | |||
| 126 |