Completed
Pull Request — master (#45)
by Christoffer
02:03
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;
4
5
trait ContextAwareTrait
6
{
7
    /**
8
     * @var ValidationContextInterface
9
     */
10
    protected $context;
11
12
    /**
13
     * @return ValidationContextInterface
14
     */
15
    public function getContext(): ValidationContextInterface
16
    {
17
        return $this->context;
18
    }
19
20
    /**
21
     * @param ValidationContextInterface $context
22
     * @return $this
23
     */
24
    public function setContext(ValidationContextInterface $context)
25
    {
26
        $this->context = $context;
27
        return $this;
28
    }
29
}
30