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.
Test Setup Failed
Push — master ( 273301...d40dfb )
by Nikhil
19:35 queued 09:51
created

MakeTransformer::includeRacks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace App\Transformers;
4
5
use App\Make;
6
use League\Fractal\TransformerAbstract;
7
8
class MakeTransformer extends TransformerAbstract
9
{
10
    /**
11
     * List of resources possible to include.
12
     *
13
     * @var array
14
     */
15
    protected $availableIncludes = ['racks', 'models', 'purchases', 'guitars'];
16
17
    /**
18
     * Turn this item object into a generic array.
19
     *
20
     * @param Make $make
21
     *
22
     * @return array
23
     */
24 1
    public function transform(Make $make)
25
    {
26
        return [
27 1
            'id'   => $make->id,
28 1
            'name' => $make->name,
29 1
        ];
30
    }
31
32
    /**
33
     * Include racks.
34
     *
35
     * @param Make $make
36
     *
37
     * @return \League\Fractal\Resource\Collection
38
     */
39
    public function includeRacks(Make $make)
40
    {
41
        return $this->collection($make->racks, new RackTransformer);
0 ignored issues
show
Documentation introduced by
new \App\Transformers\RackTransformer() is of type object<App\Transformers\RackTransformer>, but the function expects a callable.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
42
    }
43
44
    /**
45
     * Include models.
46
     *
47
     * @param Make $make
48
     *
49
     * @return \League\Fractal\Resource\Collection
50
     */
51
    public function includeModels(Make $make)
52
    {
53
        return $this->collection($make->models, new ModelTransformer);
0 ignored issues
show
Documentation introduced by
new \App\Transformers\ModelTransformer() is of type object<App\Transformers\ModelTransformer>, but the function expects a callable.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
54
    }
55
56
    /**
57
     * Include purchases.
58
     *
59
     * @param Make $make
60
     *
61
     * @return \League\Fractal\Resource\Collection
62
     */
63
    public function includePurchases(Make $make)
64
    {
65
        return $this->collection($make->purchases, new PurchaseTransformer);
0 ignored issues
show
Documentation introduced by
new \App\Transformers\PurchaseTransformer() is of type object<App\Transformers\PurchaseTransformer>, but the function expects a callable.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
66
    }
67
68
    /**
69
     * Include guitars.
70
     *
71
     * @param Make $make
72
     *
73
     * @return \League\Fractal\Resource\Collection
74
     */
75
    public function includeGuitars(Make $make)
76
    {
77
        return $this->collection($make->guitars, new GuitarTransformer);
0 ignored issues
show
Documentation introduced by
new \App\Transformers\GuitarTransformer() is of type object<App\Transformers\GuitarTransformer>, but the function expects a callable.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
78
    }
79
}
80