| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 16 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 41 | public function getApiQueueStatus()  | 
            ||
| 42 |     { | 
            ||
| 43 |         if (!class_exists(GuzzleClient::class)) { | 
            ||
| 44 | throw new MonitoringException(  | 
            ||
| 45 | 'The guzzle http client library is required to run rabbitmq health checks. '  | 
            ||
| 46 | .'Make sure to add guzzlehttp/guzzle to your composer.json.'  | 
            ||
| 47 | );  | 
            ||
| 48 | }  | 
            ||
| 49 | |||
| 50 | $client = new GuzzleClient();  | 
            ||
| 51 | $client->setConfig(['curl.options' => [CURLOPT_CONNECTTIMEOUT_MS => 3000]]);  | 
            ||
| 52 |         $request = $client->get(sprintf('%s/queues', $this->settings['console_url'])); | 
            ||
| 53 | $request->setAuth($this->settings['user'], $this->settings['pass']);  | 
            ||
| 54 | |||
| 55 | return json_decode($request->send()->getBody(true), true);  | 
            ||
| 56 | }  | 
            ||
| 57 | }  | 
            ||
| 58 |