Completed
Push — master ( b26393...c85308 )
by Scott
04:39
created

Categories   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 12 2
1
<?php namespace Bedard\Shop\Api;
2
3
use Bedard\Shop\Classes\ApiController;
4
use Bedard\Shop\Repositories\CategoryRepository;
5
use Exception;
6
use Log;
7
8
class Categories extends ApiController
9
{
10
    /**
11
     * Fetch categories.
12
     *
13
     * @return \October\Rain\Database\Collection
14
     */
15
    public function index(CategoryRepository $repository)
16
    {
17
        try {
18
            $data = input();
19
20
            return $repository->fetch($data);
21
        } catch (Exception $e) {
22
            Log::error($e->getMessage());
23
24
            abort(500, $e->getMessage());
25
        }
26
    }
27
}
28