Completed
Push — master ( d7f80a...ef11a8 )
by Dmitry
03:55
created

Job   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 7
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 39
ccs 0
cts 28
cp 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A dispatch() 0 4 1
A fire() 0 4 1
A get() 0 4 1
A find() 0 4 1
A findOne() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
namespace Basis;
4
5
use Tarantool\Mapper\Mapper;
6
7
abstract class Job
8
{
9
    private $app;
10
11
    public function __construct(Application $app)
12
    {
13
        $this->app = $app;
14
    }
15
16
    public function create($space, $data)
17
    {
18
        return $this->get(Mapper::class)->create($space, $data);
19
    }
20
21
    public function dispatch($job, $params = [])
22
    {
23
        return $this->app->dispatch($job, $params);
24
    }
25
26
    public function fire($event, $context)
27
    {
28
        return $this->get(Event::class)->fire($event, $context);
29
    }
30
31
    public function get($class)
32
    {
33
        return $this->app->get($class);
34
    }
35
36
    public function find($space, $params = [])
37
    {
38
        return $this->get(Mapper::class)->find($space, $params);
39
    }
40
41
    public function findOne($space, $params = [])
42
    {
43
        return $this->get(Mapper::class)->findOne($space, $params);
44
    }
45
}
46