Completed
Branch master (1d1574)
by Evgenij
18:38
created

SelectContext::getWrite()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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
11
namespace AsyncSockets\Socket;
12
13
/**
14
 * Class SelectContext
15
 */
16
class SelectContext
17
{
18
    /**
19
     * List os sockets ready to read
20
     *
21
     * @var StreamResourceInterface[]
22
     */
23
    private $read;
24
25
    /**
26
     * List of sockets ready to write
27
     *
28
     * @var StreamResourceInterface[]
29
     */
30
    private $write;
31
32
    /**
33
     * Constructor
34
     *
35
     * @param StreamResourceInterface[] $read List of ready to read sockets
36
     * @param StreamResourceInterface[] $write List of ready to write sockets
37
     */
38 67
    public function __construct(array $read, array $write)
39
    {
40 67
        $this->read  = $read;
41 67
        $this->write = $write;
42 67
    }
43
44
    /**
45
     * Get ready to read sockets
46
     *
47
     * @return StreamResourceInterface[]
48
     */
49 66
    public function getRead()
50
    {
51 66
        return $this->read;
52
    }
53
54
    /**
55
     * Get ready to write sockets
56
     *
57
     * @return StreamResourceInterface[]
58
     */
59 65
    public function getWrite()
60
    {
61 65
        return $this->write;
62
    }
63
}
64