ConnectionLessSocketSpecification::isSatisfiedBy()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * Async sockets
4
 *
5
 * @copyright Copyright (c) 2015-2017, 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\RequestExecutor\Specification;
11
12
use AsyncSockets\Operation\ReadOperation;
13
use AsyncSockets\RequestExecutor\Metadata\RequestDescriptor;
14
use AsyncSockets\Socket\UdpClientSocket;
15
16
/**
17
 * Class ConnectionLessSocketSpecification
18
 */
19
class ConnectionLessSocketSpecification implements SpecificationInterface
20
{
21
    /** {@inheritdoc} */
22 125
    public function isSatisfiedBy(RequestDescriptor $requestDescriptor)
23
    {
24 125
        return $requestDescriptor->getSocket() instanceof UdpClientSocket &&
25 125
               $requestDescriptor->getOperation() instanceof ReadOperation;
26
    }
27
}
28