Completed
Push — master ( 76be0a...39bc69 )
by Mariano
02:47
created

src/Command/Response/InvalidResponseException.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Disque\Command\Response;
3
4
use Disque\Command\CommandInterface;
5
use Disque\DisqueException;
6
7
class InvalidResponseException extends DisqueException
8
{
9 94
    /**
10
     * Response
11 94
     *
12
     * @var string
13
     */
14
    private $response;
15 94
16 View Code Duplication
    public function __construct(CommandInterface $command, $response)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        parent::__construct(sprintf("Invalid command response. Command %1s got: %2s",
19
            get_class($command),
20
            json_encode($response)
21
        ));
22
        $this->response = $response;
23
    }
24
25
    /**
26
     * Get actual response (if any) that triggered this exception
27
     *
28
     * @return string? Response
0 ignored issues
show
The doc-type string? could not be parsed: Unknown type name "string?" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
29
     */
30
    public function getResponse()
31
    {
32
        return $this->response;
33
    }
34
}