Completed
Push — master ( ceb702...82afac )
by Dmitry
01:41
created

Procedure   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
getBody() 0 1 ?
getParams() 0 1 ?
A getName() 0 6 1
A __invoke() 0 4 1
1
<?php
2
3
namespace Tarantool\Mapper;
4
5
use Tarantool\Mapper\Plugin\Procedure as ProcedurePlugin;
6
7
abstract class Procedure
8
{
9
    private $plugin;
10
11
    public function __construct(ProcedurePlugin $plugin)
12
    {
13
        $this->plugin = $plugin;
14
    }
15
16
    abstract public function getBody() : string;
17
    abstract public function getParams() : array;
18
19
    public function getName()
20
    {
21
        $class = get_class($this);
22
        $name = str_replace("Procedure\\", '', $class);
23
        return strtolower(implode('_', explode('\\', $name)));
24
    }
25
26
    public function __invoke()
27
    {
28
        return $this->plugin->invoke($this, func_get_args());
29
    }
30
}
31