Completed
Pull Request — master (#86)
by Vladimir
38:05 queued 09:07
created

CompilerPreRenderTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 21
ccs 2
cts 5
cp 0.4
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustomVariables() 0 4 1
A appendCustomVariables() 0 4 1
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/stakx-io/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Event;
9
10
trait CompilerPreRenderTrait
11
{
12
    protected $customVariables = [];
13
14 12
    public function getCustomVariables()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
15
    {
16 12
        return $this->customVariables;
17
    }
18
19
    /**
20
     * Append custom variables that'll be made available as template variables in PageViews.
21
     *
22
     * @param array $customVariables
23
     *
24
     * @since 0.2.0
25
     */
26
    public function appendCustomVariables(array $customVariables)
27
    {
28
        $this->customVariables = array_merge($this->customVariables, $customVariables);
29
    }
30
}
31