WrongJob   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 15
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A canRetry() 0 3 1
A execute() 0 3 1
A getTtr() 0 3 1
1
<?php
2
3
namespace tests\app\jobs;
4
5
use Exception;
6
use yii\queue\JobInterface;
7
use yii\queue\RetryableJobInterface;
8
9
/**
10
 * Wrong Job
11
 */
12
class WrongJob implements JobInterface, RetryableJobInterface
13
{
14
    public function execute($queue)
15
    {
16
        throw new Exception('Test exception.');
17
    }
18
19
    public function getTtr()
20
    {
21
        return 10;
22
    }
23
24
    public function canRetry($attempt, $error)
25
    {
26
        return $attempt < 2;
27
    }
28
}
29