Completed
Push — master ( 8eb315...5aaba6 )
by Changwan
04:29
created

BeanstalkdJob   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 26
ccs 0
cts 12
cp 0
rs 10
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getJob() 0 4 1
A payload() 0 4 1
1
<?php
2
namespace Wandu\Q\Adapter;
3
4
use Pheanstalk\Job as PheanstalkJob;
5
use Wandu\Q\Contracts\AdapterJob;
6
7
class BeanstalkdJob implements AdapterJob
8
{
9
    /** @var \Pheanstalk\Job */
10
    protected $job;
11
    
12
    public function __construct(PheanstalkJob $job)
13
    {
14
        $this->job = $job;
15
    }
16
17
    /**
18
     * @return \Pheanstalk\Job
19
     */
20
    public function getJob(): PheanstalkJob
21
    {
22
        return $this->job;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function payload(): string
29
    {
30
        return $this->job->getData();
31
    }
32
}
33