SyncConnection::push()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace WP_Queue\Connections;
4
5
use Exception;
6
use WP_Queue\Job;
7
8
class SyncConnection implements ConnectionInterface {
9
	/**
10
	 * Execute the job immediately without pushing to the queue.
11
	 *
12
	 * @param Job $job
13
	 * @param int $delay
14
	 *
15
	 * @return bool|int
16
	 */
17
	public function push(Job $job, $delay = 0) {
18
		$job->handle();
19
20
		return true;
21
	}
22
23
	/**
24
	 * Retrieve a job from the queue.
25
	 *
26
	 * @return bool|Job
27
	 */
28
	public function pop() {
29
		return false;
30
	}
31
32
	/**
33
	 * Delete a job from the queue.
34
	 *
35
	 * @param Job $job
36
	 *
37
	 * @return bool
38
	 */
39
	public function delete($job) {
40
		return false;
41
	}
42
43
	/**
44
	 * Release a job back onto the queue.
45
	 *
46
	 * @param Job $job
47
	 *
48
	 * @return bool
49
	 */
50
	public function release($job) {
51
		return false;
52
	}
53
54
	/**
55
	 * Push a job onto the failure queue.
56
	 *
57
	 * @param Job       $job
58
	 * @param Exception $exception
59
	 *
60
	 * @return bool
61
	 */
62
	public function failure($job, Exception $exception) {
63
		return false;
64
	}
65
66
	/**
67
	 * Get total jobs in the queue.
68
	 *
69
	 * @return int
70
	 */
71
	public function jobs() {
72
		return 0;
73
	}
74
75
	/**
76
	 * Get total jobs in the failures queue.
77
	 *
78
	 * @return int
79
	 */
80
	public function failed_jobs() {
81
		return 0;
82
	}
83
}
84