Passed
Push — master ( 62ccc4...3821b3 )
by Roman
01:54
created

WrongJob::getTtr()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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