Completed
Pull Request — master (#45)
by Christoffer
02:04
created

ContextAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setContext() 0 4 1
A getContext() 0 3 1
1
<?php
2
3
namespace Digia\GraphQL\Validation\Rule;
4
5
use Digia\GraphQL\Validation\ValidationContext;
6
7
trait ContextAwareTrait
8
{
9
    /**
10
     * @var ValidationContext
11
     */
12
    protected $context;
13
14
    /**
15
     * @return ValidationContext
16
     */
17
    public function getContext(): ValidationContext
18
    {
19
        return $this->context;
20
    }
21
22
    /**
23
     * @param ValidationContext $context
24
     * @return $this
25
     */
26
    public function setContext(ValidationContext $context)
27
    {
28
        $this->context = $context;
29
        return $this;
30
    }
31
}
32