@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $entityMethods = get_class_methods($this); |
21 | 21 | $params = []; |
22 | 22 | |
23 | - array_walk($entityMethods, function ($method) use (&$entity, &$params) { |
|
23 | + array_walk($entityMethods, function($method) use (&$entity, &$params) { |
|
24 | 24 | if (substr($method, 0, 3) == 'get') { |
25 | 25 | $entityProperty = lcfirst(substr($method, 3)); |
26 | 26 | if (isset($entity->$entityProperty)) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $propIndex = array_search($entityProperty, $entity->requiredFields, true); |
37 | 37 | |
38 | - if($propIndex > -1) { |
|
38 | + if ($propIndex > -1) { |
|
39 | 39 | unset($entity->requiredFields[$propIndex]); |
40 | 40 | } |
41 | 41 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | protected function draw(array $result, string $responseClassName): AbstractResponse |
48 | 48 | { |
49 | 49 | $collection = new EntityCollection(); |
50 | - array_walk($result, function ($item) use ($collection, $responseClassName) { |
|
50 | + array_walk($result, function($item) use ($collection, $responseClassName) { |
|
51 | 51 | $collection->push(ResponseDtoBuilder::make($responseClassName, $item)); |
52 | 52 | }); |
53 | 53 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | |
53 | 53 | $this->addCurlOpt(CURLOPT_HTTPHEADER, $this->curlHeaders); |
54 | 54 | |
55 | - array_walk($this->curlOptions, function ($value, $option, $curl) { |
|
55 | + array_walk($this->curlOptions, function($value, $option, $curl) { |
|
56 | 56 | curl_setopt($curl, $option, $value); |
57 | 57 | }, $curl); |
58 | 58 |
@@ -17,13 +17,13 @@ |
||
17 | 17 | $bodyParams = $this->buildRequestParams($params); |
18 | 18 | |
19 | 19 | $this->addCurlOpt(CURLOPT_URL, "{$this->credentials->getHost()}{$endpoint}") |
20 | - ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::POST) |
|
21 | - ->addCurlOpt(CURLOPT_ENCODING, '') |
|
22 | - ->addCurlOpt(CURLOPT_MAXREDIRS, 10) |
|
23 | - ->addCurlOpt(CURLOPT_TIMEOUT, 0) |
|
24 | - ->addCurlOpt(CURLOPT_FOLLOWLOCATION, true) |
|
25 | - ->addCurlOpt(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1) |
|
26 | - ->addCurlOpt(CURLOPT_POSTFIELDS, $bodyParams); |
|
20 | + ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::POST) |
|
21 | + ->addCurlOpt(CURLOPT_ENCODING, '') |
|
22 | + ->addCurlOpt(CURLOPT_MAXREDIRS, 10) |
|
23 | + ->addCurlOpt(CURLOPT_TIMEOUT, 0) |
|
24 | + ->addCurlOpt(CURLOPT_FOLLOWLOCATION, true) |
|
25 | + ->addCurlOpt(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1) |
|
26 | + ->addCurlOpt(CURLOPT_POSTFIELDS, $bodyParams); |
|
27 | 27 | |
28 | 28 | $this->auth($bodyParams); |
29 | 29 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $queryString = $this->buildRequestParams($queryParams); |
18 | 18 | $url = $this->credentials->getHost() . $endpoint . '?' . $queryString; |
19 | 19 | $this->addCurlOpt(CURLOPT_URL, $this->credentials->getHost() . $endpoint . '?' . $queryString) |
20 | - ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::GET); |
|
20 | + ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::GET); |
|
21 | 21 | |
22 | 22 | $this->auth($queryString); |
23 | 23 |
@@ -42,16 +42,16 @@ |
||
42 | 42 | */ |
43 | 43 | public function execute(): void |
44 | 44 | { |
45 | - $this->worker->onWorkerStart = function () { |
|
46 | - $connection = new AsyncTcpConnection($this->hostStream.'/'.self::CHANNEL_ACCESS.'/'.$this->streamType); |
|
45 | + $this->worker->onWorkerStart = function() { |
|
46 | + $connection = new AsyncTcpConnection($this->hostStream . '/' . self::CHANNEL_ACCESS . '/' . $this->streamType); |
|
47 | 47 | $connection->transport = 'ssl'; |
48 | - $connection->onConnect = function ($connection) { |
|
48 | + $connection->onConnect = function($connection) { |
|
49 | 49 | $connection->send(json_encode(["op" => $this->operation, "args" => $this->topic])); |
50 | 50 | }; |
51 | 51 | |
52 | 52 | $callback = $this->callback; |
53 | 53 | |
54 | - $connection->onMessage = function ($connection, $message) use ($callback) { |
|
54 | + $connection->onMessage = function($connection, $message) use ($callback) { |
|
55 | 55 | $message = json_decode($message, true); |
56 | 56 | |
57 | 57 | // Default DTO |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public static function assign($value, $defaultValue = null) |
17 | 17 | { |
18 | - return (string) $value ?? $defaultValue; |
|
18 | + return (string)$value ?? $defaultValue; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | public static function assign($value, $defaultValue = 0): int |
41 | 41 | { |
42 | - return (int) $value ?? $defaultValue; |
|
42 | + return (int)$value ?? $defaultValue; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |