| Conditions | 9 |
| Paths | 192 |
| Total Lines | 11 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 37 | public function __toString(){ |
||
| 38 | $d = []; |
||
| 39 | if ($this->scheme) $d[] = "{$this->scheme}://"; |
||
| 40 | if ($this->user) $d[] = "{$this->user}" . (empty($this->pass)?'':":{$this->pass}") . "@"; |
||
| 41 | if ($this->host) $d[] = "{$this->host}"; |
||
| 42 | if ($this->port) $d[] = ":{$this->port}"; |
||
| 43 | if ($this->path) $d[] = "/" . ltrim($this->path,"/"); |
||
| 44 | if ($this->query) $d[] = "?" . http_build_query($this->query); |
||
|
|
|||
| 45 | if ($this->fragment) $d[] = "#{$this->fragment}"; |
||
| 46 | return implode('', $d); |
||
| 47 | } |
||
| 48 | |||
| 50 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.