Completed
Branch 0.4-dev (999b58)
by Evgenij
18:41
created

SelectContext::getWrite()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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
     * array
34
     *
35
     * @var array
36
     */
37
    private $oob;
38 67
39
    /**
40 67
     * Constructor
41 67
     *
42 67
     * @param StreamResourceInterface[] $read List of ready to read sockets
43
     * @param StreamResourceInterface[] $write List of ready to write sockets
44
     * @param StreamResourceInterface[] $oob List of sockets having OOB data
45
     */
46
    public function __construct(array $read, array $write, array $oob)
47
    {
48
        $this->read  = $read;
49 66
        $this->write = $write;
50
        $this->oob   = $oob;
51 66
    }
52
53
    /**
54
     * Get ready to read sockets
55
     *
56
     * @return StreamResourceInterface[]
57
     */
58
    public function getRead()
59 65
    {
60
        return $this->read;
61 65
    }
62
63
    /**
64
     * Get ready to write sockets
65
     *
66
     * @return StreamResourceInterface[]
67
     */
68
    public function getWrite()
69
    {
70
        return $this->write;
71
    }
72
73
    /**
74
     * Return sockets having OOB data
75
     *
76
     * @return StreamResourceInterface[]
77
     */
78
    public function getOob()
79
    {
80
        return $this->oob;
81
    }
82
}
83