Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

CampaignController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace DoeSangue\Http\Controllers\API\V1;
4
5
use DoeSangue\Http\Controllers\Controller;
6
use DoeSangue\Models\Campaign;
7
use DoeSangue\Http\Resources\Campaign as CampaignResource;
8
use DoeSangue\Http\Resources\CampaignCollection;
9
10
11
class CampaignController extends Controller
12
{
13
    /**
14
     * Initialize the class
15
     * and set the middleware
16
     */
17 1
    public function __construct()
18
    {
19 1
        $this->middleware('jwt.auth', [ 'except' => [ 'index', 'show' ] ]);
20 1
    }
21
22
    /**
23
     * Get all campaigns
24
     * 20 queries per page
25
     *
26
     * @return CampaignCollection
27
     */
28 1
    public function index()
29
    {
30 1
        return new CampaignCollection(Campaign::paginate(30));
31
    }
32
33
    /**
34
     * Get all details of a campaign
35
     *
36
     * @return CampaignResource
37
     */
38
    public function show($campaign)
39
    {
40
41
        return new CampaignResource(Campaign::find($campaign));
42
43
    }
44
45
}
46