@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | public function __construct(string $host = 'localhost', string $port = '15672', string $user = 'guest', string $password = 'guest') |
| 12 | 12 | { |
| 13 | - $this->baseUrl = 'http://' . $user . ':' . $password . '@' . $host . ':' . $port; |
|
| 13 | + $this->baseUrl = 'http://'.$user.':'.$password.'@'.$host.':'.$port; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function overview(): array |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $vhosts[] = $item; |
| 28 | 28 | continue; |
| 29 | 29 | } |
| 30 | - $permissions = $this->call('/api/vhosts/' . urlencode($item['name']) . '/permissions'); |
|
| 30 | + $permissions = $this->call('/api/vhosts/'.urlencode($item['name']).'/permissions'); |
|
| 31 | 31 | foreach ($permissions as $permission) { |
| 32 | 32 | if ($permission['user'] === $user) { |
| 33 | 33 | $vhosts[] = $item; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $endpoint = '/api/queues'; |
| 44 | 44 | if ($vhost) { |
| 45 | - $endpoint .= '/' . urlencode($vhost); |
|
| 45 | + $endpoint .= '/'.urlencode($vhost); |
|
| 46 | 46 | } |
| 47 | 47 | $queues = $this->call($endpoint); |
| 48 | 48 | return $queues; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return []; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $endpoint = '/api/queues/' . urlencode($vhost) . '/' . urlencode($queue) . '/get'; |
|
| 64 | + $endpoint = '/api/queues/'.urlencode($vhost).'/'.urlencode($queue).'/get'; |
|
| 65 | 65 | $params = [ |
| 66 | 66 | 'count' => $count, |
| 67 | 67 | 'requeue' => true, |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | private function call(string $endpoint, string $method = 'GET', ?array $params = null): array |
| 75 | 75 | { |
| 76 | - $ch = curl_init($this->baseUrl . $endpoint); |
|
| 76 | + $ch = curl_init($this->baseUrl.$endpoint); |
|
| 77 | 77 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 78 | 78 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
| 79 | 79 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if (!$response) { |
| 87 | 87 | return []; |
| 88 | 88 | } |
| 89 | - $result = json_decode((string)$response, true); |
|
| 89 | + $result = json_decode((string) $response, true); |
|
| 90 | 90 | if (isset($result['error'])) { |
| 91 | 91 | throw new ConnectException($result['reason']); |
| 92 | 92 | } |