Completed
Push — master ( ec1ffe...1f9c3e )
by Ryota
02:11
created

Job::getJobName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Tavii\SQSJobQueue\Job;
3
4
/**
5
 * Class Job
6
 * @package SQSJobQueue\Job
7
 */
8
abstract class Job implements JobInterface
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $args;
14
15
    /**
16
     * @param array $args
17
     */
18
    public function __construct(array $args = array())
19
    {
20
        $this->args = $args;
21
    }
22
23
    /**
24
     * @return bool
25
     */
26
    public function execute()
27
    {
28
        return $this->run();
29
    }
30
31
    /**
32
     * @return boolean
33
     */
34
    abstract protected function run();
35
36
    /**
37
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be JobName?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
38
     */
39
    public function getJobName()
40
    {
41
        return new JobName($this->getName(), $this->getPrefix());
42
    }
43
44
    /**
45
     * get job name
46
     * @return string
47
     */
48
    public function getClassName()
49
    {
50
        return get_class($this);
51
    }
52
53
    /**
54
     * get args
55
     * @return array
56
     */
57
    public function getArgs()
58
    {
59
        return $this->args;
60
    }
61
}