Completed
Push — master ( c70864...b6d4e5 )
by Dmitry
03:30 queued 27s
created

Call   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 22
ccs 5
cts 6
cp 0.8333
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 1
    public function run()
16
    {
17 1
        $instance = $this->findOrFail($this->space, $this->id);
18
19 1
        if (!method_exists($instance, $this->method)) {
20
            throw new Exception("Method $this->method not defined");
21
        }
22
23 1
        $method = $this->method;
24
25
        return [
26 1
            'result' => $instance->$method(),
27
        ];
28
    }
29
}
30