Passed
Push — master ( b6588e...364135 )
by Vladislav
10:17 queued 08:02
created

DefaultCallbackHandler::apiExceptionHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Core\Objects\WebSockets\Channels;
4
5
use Carpenstar\ByBitAPI\Core\Exceptions\ApiException;
6
use Carpenstar\ByBitAPI\Core\Objects\ExceptionResponse;
7
use Workerman\Connection\TcpConnection;
0 ignored issues
show
Bug introduced by
The type Workerman\Connection\TcpConnection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Carpenstar\ByBitAPI\Core\Interfaces\IResponseDataInterface;
9
use Carpenstar\ByBitAPI\Core\Objects\WebSockets\Entity\WebSocketConnectionResponse;
10
11
class DefaultCallbackHandler extends ChannelHandler
12
{
13
    /**
14
     * Обработчик исключений которые приходят от API
15
     *
16
     * @param ExceptionResponse $dtoMessage
17
     * @param TcpConnection $connection
18
     * @return void
19
     * @throws ApiException
20
     */
21
    public function apiExceptionHandler(ExceptionResponse $dtoMessage, TcpConnection $connection): void
22
    {
23
        throw new ApiException($dtoMessage->getReturnMessage());
24
    }
25
26
27
    /**
28
     * Обработчик сообщения о коннекте
29
     *
30
     * @param WebSocketConnectionResponse $message
31
     * @param TcpConnection $connection
32
     * @return void
33
     */
34
    public function connectionHandle(WebSocketConnectionResponse $message, TcpConnection $connection): void
35
    {
36
        var_dump($message);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($message) looks like debug code. Are you sure you do not want to remove it?
Loading history...
37
    }
38
39
    /**
40
     * Обработчик обычного тела сообщения
41
     *
42
     * @param IResponseDataInterface $message
43
     * @param TcpConnection $connection
44
     * @return void
45
     */
46
    public function handle(IResponseDataInterface $message, TcpConnection $connection): void
47
    {
48
        var_dump($message);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($message) looks like debug code. Are you sure you do not want to remove it?
Loading history...
49
    }
50
}
51