Server   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A jobs() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Lookyman\Rundeck\Api\Endpoints\Scheduler;
5
6
use GuzzleHttp\Promise\PromiseInterface;
7
use Lookyman\Rundeck\Api\Client;
8
use GuzzleHttp\Psr7\Request;
9
10
class Server
11
{
12
	/**
13
	 * @var Client
14
	 */
15
	private $client;
16
17
	/**
18
	 * @param Client $client
19
	 */
20
	public function __construct(Client $client)
21
	{
22
		$this->client = $client;
23
	}
24
25
	/**
26
	 * @param string $uuid
27
	 * @return PromiseInterface
28
	 */
29
	public function jobs(string $uuid): PromiseInterface
30
	{
31
		return $this->client->getConfiguration()->getGuzzle()->sendAsync(
32
			new Request('GET', $this->client->getConfiguration()->getBaseUri() . sprintf('/scheduler/server/%s/jobs', urlencode($uuid)))
33
		);
34
	}
35
}
36