@@ -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,7 +17,7 @@ |
||
| 17 | 17 | $queryString = $this->buildRequestParams($queryParams); |
| 18 | 18 | |
| 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 | |
@@ -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 | |
@@ -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 | /** |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function execute(): void |
| 45 | 45 | { |
| 46 | - $this->worker->onWorkerStart = function () { |
|
| 46 | + $this->worker->onWorkerStart = function() { |
|
| 47 | 47 | |
| 48 | 48 | $heartbeatTimerId = null; |
| 49 | 49 | |
| 50 | - $connection = new AsyncTcpConnection($this->hostStream.'/'.self::CHANNEL_ACCESS.'/'.$this->streamType); |
|
| 50 | + $connection = new AsyncTcpConnection($this->hostStream . '/' . self::CHANNEL_ACCESS . '/' . $this->streamType); |
|
| 51 | 51 | $connection->transport = 'ssl'; |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @param $connection |
| 57 | 57 | * @return void |
| 58 | 58 | */ |
| 59 | - $connection->onConnect = function ($connection) use (&$heartbeatTimerId) { |
|
| 59 | + $connection->onConnect = function($connection) use (&$heartbeatTimerId) { |
|
| 60 | 60 | $connection->send(json_encode(["op" => $this->operation, "args" => $this->topic])); |
| 61 | 61 | |
| 62 | 62 | $heartbeatTimerId = Timer::add(20, function() use ($connection) { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @return void |
| 75 | 75 | * @throws \Exception |
| 76 | 76 | */ |
| 77 | - $connection->onMessage = function ($connection, $message) use ($callback) { |
|
| 77 | + $connection->onMessage = function($connection, $message) use ($callback) { |
|
| 78 | 78 | $message = json_decode($message, true); |
| 79 | 79 | |
| 80 | 80 | $responseDto = $this->getResponseClassname($this->streamType); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * @param $connection |
| 106 | 106 | * @return void |
| 107 | 107 | */ |
| 108 | - $this->worker->onClose = function ($connection) use (&$heartbeatTimerId) { |
|
| 108 | + $this->worker->onClose = function($connection) use (&$heartbeatTimerId) { |
|
| 109 | 109 | Timer::del($heartbeatTimerId); |
| 110 | 110 | }; |
| 111 | 111 | |