Completed
Branch 0.4-dev (54e67b)
by Evgenij
02:52
created

InProgressWriteOperation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 31
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getNextOperation() 0 4 1
1
<?php
2
/**
3
 * Async sockets
4
 *
5
 * @copyright Copyright (c) 2015-2016, Efimov Evgenij <[email protected]>
6
 *
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
namespace AsyncSockets\Operation;
11
12
/**
13
 * Class InProgressWriteOperation
14
 */
15
class InProgressWriteOperation extends WriteOperation
16
{
17
    /**
18
     * Next operation
19
     *
20
     * @var OperationInterface
21
     */
22
    private $nextOperation;
23
24
    /**
25
     * WriteOperation constructor.
26
     *
27
     * @param OperationInterface $next Scheduled next write operation
28
     * @param string             $data Data to send
29
     */
30 3
    public function __construct(OperationInterface $next = null, $data = null)
31
    {
32 3
        parent::__construct($data);
33 3
        $this->nextOperation = $next;
34 3
    }
35
36
    /**
37
     * Return NextOperation
38
     *
39
     * @return OperationInterface
40
     */
41 1
    public function getNextOperation()
42
    {
43 1
        return $this->nextOperation;
44
    }
45
}
46