Completed
Push — master ( 8085b1...79cabf )
by David
17s
created

AbstractRequest::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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 $outputType;
13
14
    /**
15
     * @var string|null
16
     */
17
    private $name;
18
19
    /**
20
     * @param mixed[] $attributes
21
     */
22
    public function __construct(array $attributes = [])
23
    {
24
        $this->outputType = $attributes['outputType'] ?? null;
25
        $this->name = $attributes['name'] ?? null;
26
    }
27
28
    /**
29
     * Returns the GraphQL return type of the request (as a string).
30
     * The string can represent the FQCN of the type or an entry in the container resolving to the GraphQL type.
31
     *
32
     * @return string|null
33
     */
34
    public function getOutputType(): ?string
35
    {
36
        return $this->outputType;
37
    }
38
39
    /**
40
     * Returns the name of the GraphQL query/mutation/field.
41
     * If not specified, the name of the method should be used instead.
42
     *
43
     * @return null|string
44
     */
45
    public function getName(): ?string
46
    {
47
        return $this->name;
48
    }
49
}
50