ContextTrait::getContext()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Spiral, Core Components
4
 *
5
 * @author Wolfy-J
6
 */
7
8
namespace Spiral\ORM\Commands\Traits;
9
10
/**
11
 * Provides ability to carry context.
12
 */
13
trait ContextTrait
14
{
15
    /**
16
     * @var array
17
     */
18
    private $context = [];
19
20
    /**
21
     * @return array
22
     */
23
    public function getContext(): array
24
    {
25
        return $this->context;
26
    }
27
28
    /**
29
     * @param string $name
30
     * @param mixed  $value
31
     */
32
    public function addContext(string $name, $value)
33
    {
34
        $this->context[$name] = $value;
35
    }
36
}