AttributesTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 4 1
A __set() 0 4 1
A __get() 0 4 1
1
<?php
2
3
namespace Boduch\Grid;
4
5
use Symfony\Component\HttpFoundation\ParameterBag;
6
7
trait AttributesTrait
8
{
9
    /**
10
     * @var ParameterBag
11
     */
12
    public $attributes;
13
14
    /**
15
     * @return ParameterBag
16
     */
17
    public function attributes()
18
    {
19
        return $this->attributes;
20
    }
21
22
    /**
23
     * @param string $name
24
     * @param string $value
25
     */
26
    public function __set($name, $value)
27
    {
28
        $this->attributes->set($name, $value);
29
    }
30
31
    /**
32
     * @param $name
33
     * @return string|null
34
     */
35
    public function __get($name)
36
    {
37
        return $this->attributes->get($name);
38
    }
39
}
40