Response::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 1
dl 0
loc 3
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace seregazhuk\React\Memcached\Protocol\Response;
4
5
use seregazhuk\React\Memcached\Exception\FailedCommandException;
6
7
abstract class Response
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $data;
13
14
    /**
15
     * @param string $data
16
     */
17
    public function __construct($data)
18
    {
19
        $this->data = $data;
20
    }
21
22
    /**
23
     * @return mixed
24
     * @throws FailedCommandException
25
     */
26
    abstract public function parse();
27
28
    /**
29
     * @throws FailedCommandException
30
     */
31
    protected function fail(): void
32
    {
33
        throw new FailedCommandException($this->data);
34
    }
35
}
36