@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | $async = $this->container->get(Config::class)->isReactFileSystem(); |
1641 | 1641 | |
1642 | 1642 | if ($async) { |
1643 | - return $this->prepareMultipartDataAsync($params)->then(function ($result) use ($class, $params, $method) { |
|
1643 | + return $this->prepareMultipartDataAsync($params)->then(function($result) use ($class, $params, $method) { |
|
1644 | 1644 | $headers = array("Content-Length" => $result->getSize(), "Content-Type" => "multipart/form-data; boundary={$result->getBoundary()}"); |
1645 | 1645 | return $this->wrapPromise($this->browser->post($method, $headers, $result), $method, $params, $class); |
1646 | 1646 | }); |
@@ -1669,12 +1669,12 @@ discard block |
||
1669 | 1669 | foreach ($params as $key => $value) { |
1670 | 1670 | |
1671 | 1671 | if ($value instanceof InputFile) { |
1672 | - array_push($promises, $filesystem->getContents($value->getPath())->then(function ($contents) use ($value, $key) { |
|
1672 | + array_push($promises, $filesystem->getContents($value->getPath())->then(function($contents) use ($value, $key) { |
|
1673 | 1673 | $data = ['name' => $key]; |
1674 | 1674 | $data['contents'] = $contents; |
1675 | 1675 | $data['filename'] = basename($value->getPath()); |
1676 | 1676 | return $data; |
1677 | - }, function ($error) { |
|
1677 | + }, function($error) { |
|
1678 | 1678 | $this->container->get(ZanzaraLogger::class)->error($error); |
1679 | 1679 | return $error; |
1680 | 1680 | })); |
@@ -1686,12 +1686,12 @@ discard block |
||
1686 | 1686 | } |
1687 | 1687 | } |
1688 | 1688 | |
1689 | - return all($promises)->then(function ($files) use ($multipart_data) { |
|
1689 | + return all($promises)->then(function($files) use ($multipart_data) { |
|
1690 | 1690 | foreach ($files as $key => $value) { |
1691 | 1691 | array_push($multipart_data, $value); |
1692 | 1692 | } |
1693 | 1693 | return new MultipartStream($multipart_data); |
1694 | - }, function ($error) { |
|
1694 | + }, function($error) { |
|
1695 | 1695 | $this->container->get(ZanzaraLogger::class)->error($error); |
1696 | 1696 | return $error; |
1697 | 1697 | }); |
@@ -1741,8 +1741,8 @@ discard block |
||
1741 | 1741 | $logger = $this->container->get(ZanzaraLogger::class); |
1742 | 1742 | |
1743 | 1743 | return $promise |
1744 | - ->then(function (ResponseInterface $response) use ($class, $mapper) { |
|
1745 | - $json = (string)$response->getBody(); |
|
1744 | + ->then(function(ResponseInterface $response) use ($class, $mapper) { |
|
1745 | + $json = (string) $response->getBody(); |
|
1746 | 1746 | $object = json_decode($json); |
1747 | 1747 | |
1748 | 1748 | if (is_scalar($object->result) && $class === "Scalar") { |
@@ -1750,13 +1750,13 @@ discard block |
||
1750 | 1750 | } |
1751 | 1751 | |
1752 | 1752 | return $mapper->mapObject($object->result, $class); |
1753 | - }, function ($e) use ($method, $params, $logger, $mapper) { |
|
1753 | + }, function($e) use ($method, $params, $logger, $mapper) { |
|
1754 | 1754 | if ($e instanceof ResponseException) { |
1755 | 1755 | // with the introduction of Local Api server (https://core.telegram.org/bots/api#using-a-local-bot-api-server) |
1756 | 1756 | // we can no longer assume that the response is with the TelegramException format, so catch any mapping |
1757 | 1757 | // exception |
1758 | 1758 | try { |
1759 | - $json = (string)$e->getResponse()->getBody(); |
|
1759 | + $json = (string) $e->getResponse()->getBody(); |
|
1760 | 1760 | $e = $mapper->mapJson($json, TelegramException::class); |
1761 | 1761 | } catch (\Exception $ignore) { |
1762 | 1762 | // ignore |