Passed
Pull Request — master (#2)
by David
02:02
created

Block   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getThemeDescriptor() 0 3 1
A __construct() 0 4 1
A getContext() 0 3 1
1
<?php
2
namespace TheCodingMachine\CMS\Block;
3
4
use TheCodingMachine\CMS\Theme\ThemeDescriptorInterface;
5
6
class Block implements BlockInterface
7
{
8
    /**
9
     * @var ThemeDescriptorInterface
10
     */
11
    private $themeDescriptor;
12
    /**
13
     * @var mixed[]
14
     */
15
    private $context;
16
17
    /**
18
     * @param ThemeDescriptorInterface $themeDescriptor
19
     * @param mixed[] $context
20
     */
21
    public function __construct(ThemeDescriptorInterface $themeDescriptor, array $context)
22
    {
23
        $this->themeDescriptor = $themeDescriptor;
24
        $this->context = $context;
25
    }
26
27
    /**
28
     * @return ThemeDescriptorInterface
29
     */
30
    public function getThemeDescriptor(): ThemeDescriptorInterface
31
    {
32
        return $this->themeDescriptor;
33
    }
34
35
    /**
36
     * @return mixed[]
37
     */
38
    public function getContext(): array
39
    {
40
        return $this->context;
41
    }
42
}
43