Completed
Push — master ( 261083...452422 )
by Rasmus
02:26
created

Configuration::copyTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
crap 1
1
<?php
2
3
namespace mindplay\unbox;
4
5
/**
6
 * This abstract base-class defines the internal state of `Container` and `ContainerFactory`
7
 */
8
abstract class Configuration
9
{
10
    /**
11
     * @var mixed[] map where component name => value
12
     */
13
    protected $values = [];
14
15
    /**
16
     * @var callable[] map where component name => factory function
17
     */
18
    protected $factory = [];
19
20
    /**
21
     * @var array map where component name => mixed list/map of parameter names
22
     */
23
    protected $factory_map = [];
24
25
    /**
26
     * @var callable[][] map where component name => list of configuration functions
27
     */
28
    protected $config = [];
29
30
    /**
31
     * @var callable[][] map where component name => mixed list/map of parameter names
32
     */
33
    protected $config_map = [];
34
35
    /**
36
     * Internally copy configuration state, e.g. from `ContainerFactory` to `Container`
37
     *
38
     * @param Configuration $target
39
     */
40 1
    protected function copyTo(Configuration $target)
41
    {
42 1
        $target->values = $this->values;
43 1
        $target->factory = $this->factory;
44 1
        $target->factory_map = $this->factory_map;
45 1
        $target->config = $this->config;
46 1
        $target->config_map = $this->config_map;
47 1
    }
48
}
49