GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch master (57668c)
by Nikhil
13:19 queued 05:38
created

PurchaseController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App\Http\Controllers\API;
4
5
use App\Transformers\PurchaseTransformer;
6
use App\Purchase;
7
use Illuminate\Routing\Controller;
8
9
class PurchaseController extends Controller
10
{
11
    /**
12
     * PurchaseController constructor.
13
     */
14 2
    public function __construct()
15
    {
16 2
        $this->middleware('auth');
17 2
    }
18
19
    /**
20
     * Get all purchases.
21
     * @return array
22
     */
23 1
    public function all()
24
    {
25 1
        $purchases = Purchase::all();
26
27 1
        return fractal()->collection($purchases, new PurchaseTransformer)
28 1
                        ->toArray();
29
    }
30
31
    /**
32
     * Get the specified purchase.
33
     *
34
     * @param $id
35
     *
36
     * @return array
37
     */
38
    public function show($id)
39
    {
40
        $purchase = Purchase::findOrFail($id);
41
42
        return fractal()->item($purchase, new PurchaseTransformer)
43
                        ->parseIncludes(['guitars', 'supplier'])
44
                        ->toArray();
45
    }
46
}
47