Code Duplication    Length = 14-26 lines in 2 locations

src/Exception/RecvDataException.php 1 location

@@ 17-30 (lines=14) @@
14
/**
15
 * Class RecvDataException. Thrown any time there is error during data receiving process
16
 */
17
class RecvDataException extends TransferException
18
{
19
    /**
20
     * @inheritDoc
21
     */
22
    public function __construct(
23
        SocketInterface $socket,
24
        $message = '',
25
        $code = 0,
26
        \Exception $previous = null
27
    ) {
28
        parent::__construct($socket, self::DIRECTION_RECV, $message, $code, $previous);
29
    }
30
}
31

src/Exception/SendDataException.php 1 location

@@ 17-42 (lines=26) @@
14
/**
15
 * Class SendDataException. Thrown any time there is a problem with sending data to remote side
16
 */
17
class SendDataException extends TransferException
18
{
19
    /**
20
     * Creates data sending failure
21
     *
22
     * @param SocketInterface $socket Socket with error
23
     *
24
     * @return SendDataException
25
     */
26
    public static function failedToSendData(SocketInterface $socket)
27
    {
28
        return new self($socket, 'Failed to send data.');
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function __construct(
35
        SocketInterface $socket,
36
        $message = '',
37
        $code = 0,
38
        \Exception $previous = null
39
    ) {
40
        parent::__construct($socket, self::DIRECTION_SEND, $message, $code, $previous);
41
    }
42
}
43