Completed
Push — master ( cbfed7...c39fb6 )
by Rafael
05:06
created

DefinitionTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 50
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A setName() 0 5 1
A getName() 0 3 1
A setDescription() 0 5 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
    /**
21
     * @var string
22
     */
23
    protected $name;
24
25
    /**
26
     * @var string
27
     */
28
    protected $description;
29
30
    /**
31
     * @return string
32
     */
33 14
    public function getName(): ?string
34
    {
35 14
        return $this->name;
36
    }
37
38
    /**
39
     * @param string $name
40
     *
41
     * @return DefinitionInterface
42
     */
43 2
    public function setName(?string $name): DefinitionInterface
44
    {
45 2
        $this->name = $name;
46
47 2
        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...
48
    }
49
50
    /**
51
     * @return string
52
     */
53 1
    public function getDescription(): ?string
54
    {
55 1
        return $this->description;
56
    }
57
58
    /**
59
     * @param string $description
60
     *
61
     * @return DefinitionInterface
62
     */
63 1
    public function setDescription(?string $description): DefinitionInterface
64
    {
65 1
        $this->description = $description;
66
67 1
        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...
68
    }
69
}
70