Completed
Push — master ( 186982...2975e7 )
by Rafael
05:12
created

DefinitionTrait::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Definition\Traits;
12
13
use Ynlo\GraphQLBundle\Definition\DefinitionInterface;
14
15
/**
16
 * Trait DefinitionTrait
17
 */
18
trait DefinitionTrait
19
{
20
    use MetaAwareTrait;
21
22
    /**
23
     * @var string
24
     */
25
    protected $name;
26
27
    /**
28
     * @var string
29
     */
30
    protected $description;
31
32
    /**
33
     * @return string
34
     */
35 28
    public function getName(): ?string
36
    {
37 28
        return $this->name;
38
    }
39
40
    /**
41
     * @param string $name
42
     *
43
     * @return DefinitionInterface
44
     */
45 27
    public function setName(?string $name): DefinitionInterface
46
    {
47 27
        $this->name = $name;
48
49 27
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Ynlo\GraphQLBundle\Defin...\Traits\DefinitionTrait which is incompatible with the type-hinted return Ynlo\GraphQLBundle\Definition\DefinitionInterface.
Loading history...
50
    }
51
52
    /**
53
     * @return string
54
     */
55 1
    public function getDescription(): ?string
56
    {
57 1
        return $this->description;
58
    }
59
60
    /**
61
     * @param string $description
62
     *
63
     * @return DefinitionInterface
64
     */
65 22
    public function setDescription(?string $description): DefinitionInterface
66
    {
67 22
        $this->description = $description;
68
69 22
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Ynlo\GraphQLBundle\Defin...\Traits\DefinitionTrait which is incompatible with the type-hinted return Ynlo\GraphQLBundle\Definition\DefinitionInterface.
Loading history...
70
    }
71
}
72