| Conditions | 3 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0987 |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 37 | 1 | public function getContents($originUrl, $fileUrl, $progress = true, $options = array()) |
|
| 38 | { |
||
| 39 | 1 | $res = null; |
|
| 40 | try { |
||
| 41 | 1 | $this->req = new FetchRequest($fileUrl, $this->io, $this->config); |
|
|
|
|||
| 42 | 1 | $res = $this->req->fetch(); |
|
| 43 | 1 | } catch (\Exception $e) { |
|
| 44 | $this->io->writeError((string)$e); |
||
| 45 | } |
||
| 46 | 1 | if ($res) { |
|
| 47 | return $res; |
||
| 48 | } else { |
||
| 49 | 1 | return parent::getContents($originUrl, $fileUrl, $progress, $options); |
|
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 67 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: