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
Push — master ( fc84de...edddc7 )
by Maxime
02:55
created

Serializer::collection()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 2
eloc 2
nc 2
nop 2
crap 2
1
<?php
2
3
namespace EllipseSynergie\ApiResponse\Serializer;
4
5
use League\Fractal\Serializer\ArraySerializer;
6
7
/**
8
 * Class Serializer
9
 */
10
class Serializer extends ArraySerializer
11
{
12
    /**
13
     * Serialize a collection.
14
     *
15
     * @param string $resourceKey
16
     * @param array  $data
17
     *
18
     * @return array
19
     */
20 3
    public function collection($resourceKey, array $data)
21
    {
22 3
        return [$resourceKey ? $resourceKey: 'data' => $data];
23
    }
24
25
    /**
26
     * Serialize an item.
27
     *
28
     * @param string $resourceKey
29
     * @param array  $data
30
     *
31
     * @return array
32
     */
33 1
    public function item($resourceKey, array $data)
34
    {
35 1
        return [$resourceKey ? $resourceKey: 'data' => $data];
36
    }
37
}
38