FrameException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getFramePicker() 0 4 1
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\Exception;
11
12
use AsyncSockets\Frame\FramePickerInterface;
13
use AsyncSockets\Socket\SocketInterface;
14
15
/**
16
 * Class FrameException
17
 */
18
class FrameException extends NetworkSocketException
19
{
20
    /**
21
     * Failed FramePicker
22
     *
23
     * @var FramePickerInterface
24
     */
25
    private $picker;
26
27
    /**
28
     * Construct the exception.
29
     *
30
     * @param FramePickerInterface  $picker Corrupted framePicker
31
     * @param SocketInterface $socket Socket object
32
     * @param string          $message The Exception message to throw.
33
     * @param int             $code The Exception code.
34
     * @param \Exception      $previous The previous exception used for the exception chaining.
35
     */
36 7
    public function __construct(
37
        FramePickerInterface $picker,
38
        SocketInterface $socket,
39
        $message = '',
40
        $code = 0,
41
        \Exception $previous = null
42
    ) {
43 7
        parent::__construct($socket, $message, $code, $previous);
44 7
        $this->picker = $picker;
45 7
    }
46
47
    /**
48
     * Return corrupted framePicker
49
     *
50
     * @return FramePickerInterface
51
     */
52 1
    public function getFramePicker()
53
    {
54 1
        return $this->picker;
55
    }
56
}
57