Passed
Pull Request — master (#15)
by Sebastian
04:12
created

Mailcode_Factory_CommandSets_Set_Variables   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 3 1
A pathName() 0 3 1
A fullName() 0 3 1
1
<?php
2
/**
3
 * @package Mailcode
4
 * @subpackage Factory
5
 * @see \Mailcode\Mailcode_Factory_CommandSets_Set_Variables
6
 */
7
8
declare(strict_types=1);
9
10
namespace Mailcode;
11
12
/**
13
 * Command set used to create variable instances.
14
 *
15
 * @package Mailcode
16
 * @subpackage Factory
17
 * @author Sebastian Mordziol <[email protected]>
18
 */
19
class Mailcode_Factory_CommandSets_Set_Variables extends Mailcode_Factory_CommandSets_Set
20
{
21
    private Mailcode_Variables $variables;
22
23
    protected function init(): void
24
    {
25
        $this->variables = Mailcode::create()->createVariables();
26
    }
27
28
    public function fullName(string $fullName) : Mailcode_Variables_Variable
29
    {
30
        return $this->variables->createVariableByName($fullName);
31
    }
32
33
    public function pathName(string $path, ?string $name=null) : Mailcode_Variables_Variable
34
    {
35
        return $this->variables->createVariable($path, $name);
36
    }
37
}
38