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.

DataArraySerializer   A
last analyzed

↳ Parent: Project

Coupling/Cohesion

Components 0
Dependencies 1

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 38
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A collection() 0 4 1
A item() 0 4 1
A null() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the League\Fractal package.
5
 *
6
 * (c) Phil Sturgeon <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace League\Fractal\Serializer;
13
14
class DataArraySerializer extends ArraySerializer
15
{
16
    /**
17
     * Serialize a collection.
18
     *
19
     * @param string $resourceKey
20
     * @param array  $data
21
     *
22
     * @return array
23
     */
24 5
    public function collection($resourceKey, array $data)
25
    {
26 5
        return ['data' => $data];
27
    }
28
29
    /**
30
     * Serialize an item.
31
     *
32
     * @param string $resourceKey
33
     * @param array  $data
34
     *
35
     * @return array
36
     */
37 6
    public function item($resourceKey, array $data)
38
    {
39 6
        return ['data' => $data];
40
    }
41
42
    /**
43
     * Serialize null resource.
44
     *
45
     * @return array
46
     */
47 1
    public function null()
48
    {
49 1
        return ['data' => []];
50
    }
51
}
52