Response::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Softonic\GraphQL;
4
5
class Response
6
{
7
    private $data;
8
    private $errors;
9
10 6
    public function __construct(array $data, array $errors = [])
11
    {
12 6
        $this->data = $data;
13 6
        $this->errors = $errors;
14 6
    }
15
16 6
    public function getData(): array
17
    {
18 6
        return $this->data;
19
    }
20
21 4
    public function getErrors(): array
22
    {
23 4
        return $this->errors;
24
    }
25
26 4
    public function hasErrors(): bool
27
    {
28 4
        return !empty($this->errors);
29
    }
30
}
31