Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function testEquals() |
||
27 | { |
||
28 | $stub = [ |
||
29 | 'http://username:password@hostname/path?arg=value#anchor', |
||
30 | '//www.example.com/path?googleguy=googley', |
||
31 | 'http://usr:[email protected]:81/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment', |
||
32 | url('/'), |
||
33 | '/', |
||
34 | ]; |
||
35 | |||
36 | foreach ($stub as $value) { |
||
37 | $compare = $this->makeComparativeUrl($value); |
||
38 | $this->assertTrue($compare->isEquals($value)); |
||
|
|||
39 | } |
||
40 | } |
||
41 | |||
50 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.