AbstractHandler::setPipeline()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * @author domenico [email protected] / [email protected]
5
 * Date: 05/11/18
6
 * Time: 14.08
7
 *
8
 */
9
10
namespace Matecat\SubFiltering\Commons;
11
12
13
abstract class AbstractHandler {
14
15
    protected string $name;
16
17
    /**
18
     * @var Pipeline
19
     */
20
    protected Pipeline $pipeline;
21
22
    /**
23
     * @param string $segment
24
     *
25
     * @return string
26
     *
27
     */
28
    public abstract function transform( string $segment ): string;
29
30
    /**
31
     * AbstractHandler constructor.
32
     */
33 121
    public function __construct() {
34 121
        $this->name = get_class( $this );
35
    }
36
37
    /**
38
     * @return string
39
     */
40 12
    public function getName(): string {
41 12
        return $this->name;
42
    }
43
44
    /**
45
     * @param Pipeline $pipeline
46
     */
47 120
    public function setPipeline( Pipeline $pipeline ) {
48 120
        $this->pipeline = $pipeline;
49
    }
50
51
    /**
52
     * @return Pipeline
53
     */
54 101
    public function getPipeline(): Pipeline {
55 101
        return $this->pipeline;
56
    }
57
58
}