CronJob   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 27
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 4 1
A getLastRunAt() 0 4 1
1
<?php
2
3
namespace JMS\JobQueueBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\Table(name = "jms_cron_jobs")
10
 * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
11
 */
12
class CronJob
13
{
14
    /** @ORM\Id @ORM\Column(type = "integer", options = {"unsigned": true}) @ORM\GeneratedValue(strategy="AUTO") */
15
    private $id;
16
17
    /** @ORM\Column(type = "string", length = 200, unique = true) */
18
    private $command;
19
20
    /** @ORM\Column(type = "datetime", name = "lastRunAt") */
21
    private $lastRunAt;
22
23 2
    public function __construct($command)
24
    {
25 2
        $this->command = $command;
26 2
        $this->lastRunAt = new \DateTime();
27 2
    }
28
29
    public function getCommand()
30
    {
31
        return $this->command;
32
    }
33
34 2
    public function getLastRunAt()
35
    {
36 2
        return $this->lastRunAt;
37
    }
38
}