Completed
Push — master ( 390e4e...b0ec12 )
by Taosikai
12:57
created

Heartbeat   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 4
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
A getInterval() 0 4 1
1
<?php
2
/**
3
 * Spike library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Spike\Client\Timer;
7
8
use Spike\Protocol\Spike;
9
10
class Heartbeat extends PeriodicTimer
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function __invoke()
16
    {
17
        $this->client->getControlConnection()->write(new Spike('ping'));
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getInterval()
24
    {
25
        return 50;
26
    }
27
}