FailedJob   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 79
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFailedAt() 0 4 1
A getName() 0 4 1
A getId() 0 4 1
A getQueueName() 0 4 1
A getWorkerName() 0 4 1
A getExceptionClass() 0 4 1
A getError() 0 4 1
A getBacktrace() 0 4 1
1
<?php
2
3
namespace Mpclarkson\ResqueBundle;
4
5
/**
6
 * Class FailedJob
7
 * @package Mpclarkson\ResqueBundle
8
 */
9
class FailedJob
10
{
11
    /**
12
     * @var array
13
     */
14
    protected $data;
15
16
    /**
17
     * @param array $data Contains the failed job data
18
     */
19
    public function __construct(array $data)
20
    {
21
        $this->data = $data;
22
    }
23
24
    /**
25
     * @return mixed
26
     */
27
    public function getFailedAt()
28
    {
29
        return $this->data['failed_at'];
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getName()
36
    {
37
        return $this->data['payload']['class'];
38
    }
39
40
    /**
41
     * @return int
42
     */
43
    public function getId()
44
    {
45
        return $this->data['payload']['id'];
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getQueueName()
52
    {
53
        return $this->data['queue'];
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getWorkerName()
60
    {
61
        return $this->data['worker'];
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getExceptionClass()
68
    {
69
        return $this->data['exception'];
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function getError()
76
    {
77
        return $this->data['error'];
78
    }
79
80
    /**
81
     * @return mixed
82
     */
83
    public function getBacktrace()
84
    {
85
        return $this->data['backtrace'];
86
    }
87
}
88