| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function getArticle($articleHash) |
||
| 36 | { |
||
| 37 | $article = new BlogArticle(); |
||
| 38 | $articleResult = $article->where("hash", $articleHash)->first(); |
||
| 39 | |||
| 40 | if ($articleResult != null) { |
||
| 41 | return FormatHelper::formatData($articleResult); |
||
| 42 | } else { |
||
| 43 | return FormatHelper::formatData(array("errorCode" => "not-found"), false, 404); |
||
| 44 | } |
||
| 46 | } |