Test Failed
Pull Request — master (#14)
by David
02:13
created

AbstractRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getReturnType() 0 4 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Annotations;
5
6
7
abstract class AbstractRequest
8
{
9
    /**
10
     * @var string|null
11
     */
12
    private $returnType;
13
14
    /**
15
     * @param mixed[] $attributes
16
     */
17
    public function __construct(array $attributes = [])
18
    {
19
        $this->returnType = $attributes['returnType'] ?? null;
20
    }
21
22
    /**
23
     * Returns the GraphQL return type of the request (as a string).
24
     * The string can represent the FQCN of the type or an entry in the container resolving to the GraphQL type.
25
     *
26
     * @return string|null
27
     */
28
    public function getReturnType(): ?string
29
    {
30
        return $this->returnType;
31
    }
32
}
33