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

ContextTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContext() 0 4 1
A addContext() 0 4 1
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
}