Completed
Push — master ( 066d89...19607d )
by De
01:54
created

AbstractProcessor::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Sokil\FraudDetector\Processor;
4
5
use Sokil\FraudDetector\Detector;
6
7
abstract class AbstractProcessor implements ProcessorInterface
8
{
9
    /**
10
     *
11
     * @var \Sokil\FraudDetector\Detector
12
     */
13
    protected $detector;
14
15
    protected function init() {}
16
17
    public function __construct(Detector $detector)
18
    {
19
        $this->detector = $detector;
20
21
        $this->init();
22
    }
23
24
    public function getName()
25
    {
26
        $fullyQualifiedClassNameChunks = explode('\\', get_called_class());
27
        $className = array_pop($fullyQualifiedClassNameChunks);
28
29
        // remove "Processor" suffix and lovercase first char
30
        return lcfirst(substr($className, 0, -9));
31
    }
32
33
    public function afterCheckPassed() {}
34
35
    public function afterCheckFailed() {}
36
}