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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 41
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A copyTo() 0 8 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