ServiceCallback::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * This file is part of the PHP Generics package.
5
 *
6
 * @package Generics
7
 */
8
namespace Generics\Socket;
9
10
/**
11
 * This abstract class is the blueprint for implementing a service callback
12
 *
13
 * @author Maik <[email protected]>
14
 *
15
 */
16
abstract class ServiceCallback
17
{
18
19
    /**
20
     * Endpoint
21
     *
22
     * @var Endpoint endpoint
23
     */
24
    private $serviceEndpoint;
25
26
    /**
27
     * Create a new service callback instance
28
     *
29
     * @param Endpoint $endPoint
30
     *            The endpoint
31
     */
32
    public function __construct(Endpoint $endPoint)
33
    {
34
        $this->serviceEndpoint = $endPoint;
35
    }
36
37
    /**
38
     * Any implementor must provide such a functions
39
     *
40
     * @return boolean true in case of service should keep on running, false if it shall stop
41
     */
42
    abstract public function callback(Socket $socket);
43
}
44