Conditions | 1 |
Paths | 1 |
Total Lines | 56 |
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'), 'default_sa'], |
||
20 | [SimplifiedRequest::fromUrl('https://example.com'), 'default_sa'], |
||
21 | [SimplifiedRequest::fromUrl('http://example.com/'), 'default_sa'], |
||
22 | [SimplifiedRequest::fromUrl('https://example.com/'), 'default_sa'], |
||
23 | [SimplifiedRequest::fromUrl('http://example.com//'), 'default_sa'], |
||
24 | [SimplifiedRequest::fromUrl('https://example.com//'), 'default_sa'], |
||
25 | [SimplifiedRequest::fromUrl('http://example.com:8080/'), 'default_sa'], |
||
26 | [SimplifiedRequest::fromUrl('http://example.com/first_siteaccess/'), 'default_sa'], |
||
27 | [SimplifiedRequest::fromUrl('http://example.com/?first_siteaccess'), 'default_sa'], |
||
28 | [SimplifiedRequest::fromUrl('http://example.com/?first_sa'), 'default_sa'], |
||
29 | [SimplifiedRequest::fromUrl('http://example.com/first_salt'), 'default_sa'], |
||
30 | [SimplifiedRequest::fromUrl('http://example.com/first_sa.foo'), 'default_sa'], |
||
31 | [SimplifiedRequest::fromUrl('http://example.com/test'), 'default_sa'], |
||
32 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/'), 'default_sa'], |
||
33 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/'), 'default_sa'], |
||
34 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/first_sa'), 'default_sa'], |
||
35 | [SimplifiedRequest::fromUrl('http://example.com/default_sa'), 'default_sa'], |
||
36 | |||
37 | [SimplifiedRequest::fromUrl('http://example.com/first_sa'), 'first_sa'], |
||
38 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/'), 'first_sa'], |
||
39 | // Double slashes shouldn't be considered as one |
||
40 | [SimplifiedRequest::fromUrl('http://example.com//first_sa//'), 'default_sa'], |
||
41 | [SimplifiedRequest::fromUrl('http://example.com///first_sa///test'), 'default_sa'], |
||
42 | [SimplifiedRequest::fromUrl('http://example.com//first_sa//foo/bar'), 'default_sa'], |
||
43 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/foo'), 'first_sa'], |
||
44 | [SimplifiedRequest::fromUrl('http://example.com:82/first_sa/'), 'first_sa'], |
||
45 | [SimplifiedRequest::fromUrl('http://third_siteaccess/first_sa/'), 'first_sa'], |
||
46 | [SimplifiedRequest::fromUrl('http://first_sa/'), 'first_sa'], |
||
47 | [SimplifiedRequest::fromUrl('https://first_sa/'), 'first_sa'], |
||
48 | [SimplifiedRequest::fromUrl('http://first_sa:81/'), 'first_sa'], |
||
49 | [SimplifiedRequest::fromUrl('http://first_siteaccess/'), 'first_sa'], |
||
50 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/'), 'first_sa'], |
||
51 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/'), 'first_sa'], |
||
52 | [SimplifiedRequest::fromUrl('http://first_siteaccess/foo/'), 'first_sa'], |
||
53 | |||
54 | [SimplifiedRequest::fromUrl('http://www.example.com/'), 'example'], |
||
55 | [SimplifiedRequest::fromUrl('https://www.example.com/'), 'example'], |
||
56 | [SimplifiedRequest::fromUrl('http://www.example.com:81/'), 'example'], |
||
57 | [SimplifiedRequest::fromUrl('http://www.example.com/'), 'example'], |
||
58 | [SimplifiedRequest::fromUrl('http://www.example.com:82/'), 'example'], |
||
59 | [SimplifiedRequest::fromUrl('https://www.example.com:83/'), 'example'], |
||
60 | [SimplifiedRequest::fromUrl('http://www.example.com/foo/'), 'example'], |
||
61 | |||
62 | [SimplifiedRequest::fromUrl('http://example.com/second_sa'), 'second_sa'], |
||
63 | [SimplifiedRequest::fromUrl('http://example.com/second_sa/'), 'second_sa'], |
||
64 | [SimplifiedRequest::fromUrl('http://example.com/second_sa?param1=foo'), 'second_sa'], |
||
65 | [SimplifiedRequest::fromUrl('http://example.com/second_sa/foo/'), 'second_sa'], |
||
66 | [SimplifiedRequest::fromUrl('http://example.com:82/second_sa/'), 'second_sa'], |
||
67 | [SimplifiedRequest::fromUrl('http://example.com:83/second_sa/'), 'second_sa'], |
||
68 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/second_sa/'), 'second_sa'], |
||
69 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/second_sa/'), 'second_sa'], |
||
70 | ]; |
||
71 | } |
||
72 | |||
136 |