System   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 1
cbo 7
dl 0
loc 49
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A info() 0 6 1
A logStorage() 0 4 1
A execution() 0 4 1
A acl() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Lookyman\Rundeck\Api\Endpoints\System;
5
6
use GuzzleHttp\Promise\PromiseInterface;
7
use GuzzleHttp\Psr7\Request;
8
use Lookyman\Rundeck\Api\Client;
9
10
class System
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
	 * @return PromiseInterface
27
	 */
28
	public function info(): PromiseInterface
29
	{
30
		return $this->client->getConfiguration()->getGuzzle()->sendAsync(
31
			new Request('GET', $this->client->getConfiguration()->getBaseUri() . '/system/info')
32
		);
33
	}
34
35
	/**
36
	 * @return LogStorage
37
	 */
38
	public function logStorage(): LogStorage
39
	{
40
		return new LogStorage($this->client);
41
	}
42
43
	/**
44
	 * @return Execution
45
	 */
46
	public function execution(): Execution
47
	{
48
		return new Execution($this->client);
49
	}
50
51
	/**
52
	 * @return Acl
53
	 */
54
	public function acl(): Acl
55
	{
56
		return new Acl($this->client);
57
	}
58
}
59