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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A collection() 0 4 2
A item() 0 4 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