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

Procedure::getBody()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
nc 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