Completed
Push — master ( 5e9169...e507aa )
by Dmitry
04:13
created

Call   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 22
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 14 2
1
<?php
2
3
namespace Basis\Job\Module;
4
5
use Basis\Job;
6
use Exception;
7
8
class Call extends Job
9
{
10
    public $space;
11
    public $id;
12
13
    public $method;
14
15
    public function run()
16
    {
17
        $instance = $this->findOrFail($this->space, $this->id);
18
19
        if (!method_exists($instance, $this->method)) {
20
            throw new Exception("Method $this->method not defined");
21
        }
22
23
        $method = $this->method;
24
25
        return [
26
            'result' => $instance->$method(),
27
        ];
28
    }
29
}
30