Ping::ping()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Workana\AsyncJobs\Util;
3
4
use Workana\AsyncJobs\JobManager;
5
use Workana\AsyncJobs\Event\PingEvent;
6
use Workana\AsyncJobs\AsyncJobsEvents;
7
8
/**
9
 * Produces a ping
10
 *
11
 * @author Carlos Frutos <[email protected]>
12
 */
13
class Ping
14
{
15
    /**
16
     * @var JobManager
17
     */
18
    protected $jm;
19
20
    public function __construct(JobManager $jm)
21
    {
22
        $this->jm = $jm;
23
    }
24
25
    /**
26
     * @return void
27
     */
28
    public function ping()
29
    {
30
        $this->jm->getEventDispatcher()->dispatch(AsyncJobsEvents::PING, new PingEvent());
31
    }
32
}