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

Mailcode_Factory_CommandSets_Set_Variables::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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