Code Duplication    Length = 18-21 lines in 4 locations

src/Client/Http/CreatePersistentSubscriptionResponseInspector.php 1 location

@@ 7-27 (lines=21) @@
4
5
use Psr\Http\Message\ResponseInterface;
6
7
final class CreatePersistentSubscriptionResponseInspector extends AbstractResponseInspector
8
{
9
    /**
10
     * @param ResponseInterface $response
11
     *
12
     * @throws BadRequestException
13
     */
14
    public function inspect(ResponseInterface $response)
15
    {
16
        $this->filterCommonErrors($response);
17
        switch ($response->getStatusCode()) {
18
            /* OK */
19
            case 201:
20
                break;
21
22
            /* KO. */
23
            default:
24
                throw $this->newBadRequestException($response);
25
        }
26
    }
27
}
28

src/Client/Http/DeletePersistentSubscriptionResponseInspector.php 1 location

@@ 7-27 (lines=21) @@
4
5
use Psr\Http\Message\ResponseInterface;
6
7
final class DeletePersistentSubscriptionResponseInspector extends AbstractResponseInspector
8
{
9
    /**
10
     * @param ResponseInterface $response
11
     *
12
     * @throws BadRequestException
13
     */
14
    public function inspect(ResponseInterface $response)
15
    {
16
        $this->filterCommonErrors($response);
17
        switch ($response->getStatusCode()) {
18
            /* OK */
19
            case 200:
20
                break;
21
22
            /* KO. */
23
            default:
24
                throw $this->newBadRequestException($response);
25
        }
26
    }
27
}
28

src/Client/Http/DeleteStreamResponseInspector.php 1 location

@@ 7-24 (lines=18) @@
4
5
use Psr\Http\Message\ResponseInterface;
6
7
final 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

src/Client/Http/UpdatePersistentSubscriptionResponseInspector.php 1 location

@@ 7-27 (lines=21) @@
4
5
use Psr\Http\Message\ResponseInterface;
6
7
final class UpdatePersistentSubscriptionResponseInspector extends AbstractResponseInspector
8
{
9
    /**
10
     * @param ResponseInterface $response
11
     *
12
     * @throws BadRequestException
13
     */
14
    public function inspect(ResponseInterface $response)
15
    {
16
        $this->filterCommonErrors($response);
17
        switch ($response->getStatusCode()) {
18
            /* OK */
19
            case 200:
20
                break;
21
22
            /* KO. */
23
            default:
24
                throw $this->newBadRequestException($response);
25
        }
26
    }
27
}
28