Conditions | 1 |
Paths | 1 |
Total Lines | 67 |
Lines | 67 |
Ratio | 100 % |
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 |
||
70 | View Code Duplication | public function matchProvider() |
|
71 | { |
||
72 | return [ |
||
73 | [SimplifiedRequest::fromUrl('http://example.com'), 'fifth_sa'], |
||
74 | [SimplifiedRequest::fromUrl('https://example.com'), 'fourth_sa'], |
||
75 | [SimplifiedRequest::fromUrl('http://example.com/'), 'fifth_sa'], |
||
76 | [SimplifiedRequest::fromUrl('https://example.com/'), 'fourth_sa'], |
||
77 | [SimplifiedRequest::fromUrl('http://example.com//'), 'fifth_sa'], |
||
78 | [SimplifiedRequest::fromUrl('https://example.com//'), 'fourth_sa'], |
||
79 | [SimplifiedRequest::fromUrl('http://example.com:8080/'), 'default_sa'], |
||
80 | [SimplifiedRequest::fromUrl('http://example.com/first_siteaccess/'), 'fifth_sa'], |
||
81 | [SimplifiedRequest::fromUrl('http://example.com/?first_siteaccess'), 'fifth_sa'], |
||
82 | [SimplifiedRequest::fromUrl('http://example.com/?first_sa'), 'fifth_sa'], |
||
83 | [SimplifiedRequest::fromUrl('http://example.com/first_salt'), 'fifth_sa'], |
||
84 | [SimplifiedRequest::fromUrl('http://example.com/first_sa.foo'), 'fifth_sa'], |
||
85 | [SimplifiedRequest::fromUrl('http://example.com/test'), 'fifth_sa'], |
||
86 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/'), 'fifth_sa'], |
||
87 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/'), 'fifth_sa'], |
||
88 | [SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/first_sa'), 'fifth_sa'], |
||
89 | [SimplifiedRequest::fromUrl('http://example.com/default_sa'), 'fifth_sa'], |
||
90 | |||
91 | [SimplifiedRequest::fromUrl('http://example.com/first_sa'), 'fifth_sa'], |
||
92 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/'), 'fifth_sa'], |
||
93 | [SimplifiedRequest::fromUrl('http://example.com/first_sa//'), 'fifth_sa'], |
||
94 | [SimplifiedRequest::fromUrl('http://example.com/first_sa///test'), 'fifth_sa'], |
||
95 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/foo'), 'fifth_sa'], |
||
96 | [SimplifiedRequest::fromUrl('http://example.com/first_sa/foo/bar'), 'fifth_sa'], |
||
97 | [SimplifiedRequest::fromUrl('http://example.com:82/first_sa/'), 'fourth_sa'], |
||
98 | [SimplifiedRequest::fromUrl('http://third_siteaccess/first_sa/'), 'third_sa'], |
||
99 | [SimplifiedRequest::fromUrl('http://first_sa/'), 'first_sa'], |
||
100 | [SimplifiedRequest::fromUrl('https://first_sa/'), 'first_sa'], |
||
101 | [SimplifiedRequest::fromUrl('http://first_sa:81/'), 'first_sa'], |
||
102 | [SimplifiedRequest::fromUrl('http://first_siteaccess/'), 'first_sa'], |
||
103 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/'), 'first_sa'], |
||
104 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/'), 'first_sa'], |
||
105 | [SimplifiedRequest::fromUrl('http://first_siteaccess/foo/'), 'first_sa'], |
||
106 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/foo/'), 'first_sa'], |
||
107 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/foo/'), 'first_sa'], |
||
108 | |||
109 | [SimplifiedRequest::fromUrl('http://example.com/second_sa'), 'fifth_sa'], |
||
110 | [SimplifiedRequest::fromUrl('http://example.com/second_sa/'), 'fifth_sa'], |
||
111 | [SimplifiedRequest::fromUrl('http://example.com/second_sa?param1=foo'), 'fifth_sa'], |
||
112 | [SimplifiedRequest::fromUrl('http://example.com/second_sa/foo/'), 'fifth_sa'], |
||
113 | [SimplifiedRequest::fromUrl('http://example.com:82/second_sa/'), 'fourth_sa'], |
||
114 | [SimplifiedRequest::fromUrl('http://example.com:83/second_sa/'), 'first_sa'], |
||
115 | [SimplifiedRequest::fromUrl('http://first_siteaccess:82/second_sa/'), 'first_sa'], |
||
116 | [SimplifiedRequest::fromUrl('http://first_siteaccess:83/second_sa/'), 'first_sa'], |
||
117 | |||
118 | [SimplifiedRequest::fromUrl('http://first_sa:123/second_sa'), 'first_sa'], |
||
119 | [SimplifiedRequest::fromUrl('http://first_siteaccess:123/second_sa/'), 'first_sa'], |
||
120 | [SimplifiedRequest::fromUrl('http://example.com:123/second_sa?param1=foo'), 'second_sa'], |
||
121 | [SimplifiedRequest::fromUrl('http://example.com:123/second_sa/foo/'), 'second_sa'], |
||
122 | [SimplifiedRequest::fromUrl('http://example.com:123/second_sa'), 'second_sa'], |
||
123 | [SimplifiedRequest::fromUrl('http://example.com:123/second_sa/'), 'second_sa'], |
||
124 | [SimplifiedRequest::fromUrl('http://example.com:123/second_sa?param1=foo'), 'second_sa'], |
||
125 | [SimplifiedRequest::fromUrl('http://example.com:123/second_sa/foo/'), 'second_sa'], |
||
126 | |||
127 | [SimplifiedRequest::fromUrl('http://example.com:81/'), 'third_sa'], |
||
128 | [SimplifiedRequest::fromUrl('https://example.com:81/'), 'third_sa'], |
||
129 | [SimplifiedRequest::fromUrl('http://example.com:81/foo'), 'third_sa'], |
||
130 | [SimplifiedRequest::fromUrl('http://example.com:81/foo/bar'), 'third_sa'], |
||
131 | |||
132 | [SimplifiedRequest::fromUrl('http://example.com:82/'), 'fourth_sa'], |
||
133 | [SimplifiedRequest::fromUrl('https://example.com:82/'), 'fourth_sa'], |
||
134 | [SimplifiedRequest::fromUrl('https://example.com:82/foo'), 'fourth_sa'], |
||
135 | ]; |
||
136 | } |
||
137 | |||
240 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..