Completed
Push — 1.x ( c183a4...05b51a )
by Alexander
8s
created

BaseSourceTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
/*
3
 * Go! AOP framework
4
 *
5
 * @copyright Copyright 2013, Lisachenko Alexander <[email protected]>
6
 *
7
 * This source file is subject to the license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Go\Instrument\Transformer;
12
13
use Go\Core\AspectKernel;
14
use Go\Core\AspectContainer;
15
16
/**
17
 * Base source transformer class definition
18
 */
19
abstract class BaseSourceTransformer implements SourceTransformer
20
{
21
22
    /**
23
     * Transformer options
24
     *
25
     * @var array
26
     */
27
    protected $options = [];
28
29
    /**
30
     * @var AspectKernel|null
31
     */
32
    protected $kernel = null;
33
34
    /**
35
     * @var AspectContainer|null
36
     */
37
    protected $container = null;
38
39
    /**
40
     * Default constructor for transformer
41
     *
42
     * @param AspectKernel $kernel Instance of aspect kernel
43
     * @param array $options Custom options or kernel options
44
     */
45 14
    public function __construct(AspectKernel $kernel, array $options = [])
46
    {
47 14
        $this->kernel    = $kernel;
48 14
        $this->container = $kernel->getContainer();
49 14
        $this->options   = $options ?: $kernel->getOptions();
50 14
    }
51
}
52