1 | <?php |
||
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 | } |