Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.125 |
1 | <?php |
||
17 | 1 | public function articles() |
|
18 | { |
||
19 | 1 | $current = Input::get('page', 1) - 1; |
|
20 | 1 | $articles = array_chunk($this->post->all('article'), Config::get('skorry.paginate')); |
|
21 | 1 | if (!count($articles)) { |
|
22 | 1 | $data = (new \Parsedown())->parse(\File::get(base_path().'/readme.md')); |
|
23 | |||
24 | 1 | return View::make('hello', compact('data')); |
|
25 | } |
||
26 | if (!array_key_exists($current, $articles)) { |
||
27 | App::abort(404); |
||
28 | } |
||
29 | $articles = $articles[$current]; |
||
30 | $paginator = Paginator::make($articles, count($this->post->all('article')), Config::get('skorry.paginate')); |
||
31 | |||
32 | return View::make('posts.articles', compact('articles', 'paginator')); |
||
33 | } |
||
34 | |||
46 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.