Completed
Pull Request — master (#2)
by
unknown
38:19
created

TestJobContract::getJobId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace SfCod\QueueBundle\Tests\Data;
4
5
use SfCod\QueueBundle\Job\JobContract;
6
use Symfony\Component\DependencyInjection\ContainerInterface;
7
8
/**
9
 * Test job
10
 *
11
 * Class TestJob
12
 *
13
 * @author Virchenko Maksim <[email protected]>
14
 *
15
 * @package SfCod\QueueBundle\Tests
16
 */
17
class TestJobContract extends JobContract
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: attempts, reserved, resolve
Loading history...
18
{
19
    /**
20
     * @var ContainerInterface
21
     */
22
    private $_container;
23
24
    /**
25
     * Get the job identifier.
26
     *
27
     * @return string
28
     */
29
    public function getJobId()
30
    {
31
        return uniqid();
32
    }
33
34
    /**
35
     * TestJob constructor.
36
     *
37
     * @param ContainerInterface $container
38
     */
39
    public function __construct(ContainerInterface $container)
40
    {
41
        $this->_container = $container;
42
    }
43
44
    /**
45
     * Get container instance
46
     *
47
     * @return ContainerInterface
48
     */
49
    public function getContainer()
50
    {
51
        return $this->_container;
52
    }
53
54
    /**
55
     * Delete job
56
     *
57
     * @throws SuccessJobException
58
     */
59
    public function delete()
60
    {
61
        throw new SuccessJobException('Job was deleted.');
62
    }
63
64
    /**
65
     * Get the raw body of the job.
66
     *
67
     * @return string
68
     */
69
    public function getRawBody()
70
    {
71
        return '';
72
    }
73
}
74