Passed
Pull Request — master (#9)
by Quang
02:11
created

ArrayConnection::connectionFromArraySlice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\Lumen\GraphQL;
4
5
use Youshido\GraphQL\Relay\Connection\ArrayConnection as BaseArrayConnection;
6
7
class ArrayConnection extends BaseArrayConnection
8
{
9
10
    /** @noinspection MoreThanThreeArgumentsInspection */
11
12
    /**
13
     * @param array $data
14
     * @param array $args
15
     * @param int   $sliceStart
16
     * @param int   $arrayLength
17
     *
18
     * @return array
19
     */
20
    public static function connectionFromArraySlice(array $data, array $args, $sliceStart, $arrayLength)
21
    {
22
        return array_merge(parent::connectionFromArraySlice($data, $args, $sliceStart, $arrayLength), [
23
            'total' => $arrayLength,
24
        ]);
25
    }
26
}
27