Completed
Branch feature/pre-split (4ff102)
by Anton
03:27
created

ContextTrait::addContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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