Response   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fail() 0 3 1
A __construct() 0 3 1
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