DeleteStreamResponseInspector::inspect()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
namespace RayRutjes\GetEventStore\Client\Http;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
class DeleteStreamResponseInspector extends AbstractResponseInspector
8
{
9
    /**
10
     * @param ResponseInterface $response
11
     */
12
    public function inspect(ResponseInterface $response)
13
    {
14
        $this->filterCommonErrors($response);
15
        switch ($response->getStatusCode()) {
16
            case 204:
17
                // OK.
18
                break;
19
            default:
20
                // KO.
21
                throw $this->newBadRequestException($response);
22
        }
23
    }
24
}
25