Completed
Push — master ( 0207b1...f7171f )
by Lukáš
72:17 queued 55:41
created

Execution::output()   B

Complexity

Conditions 7
Paths 4

Size

Total Lines 16
Code Lines 11

Duplication

Lines 16
Ratio 100 %

Importance

Changes 0
Metric Value
dl 16
loc 16
rs 8.2222
c 0
b 0
f 0
cc 7
eloc 11
nc 4
nop 4
1
<?php
2
declare(strict_types=1);
3
4
namespace Lookyman\Rundeck\Api\Endpoints\System;
5
6
use GuzzleHttp\Promise\PromiseInterface;
7
use Lookyman\Rundeck\Api\Client;
8
use GuzzleHttp\Psr7\Request;
9
10 View Code Duplication
class Execution
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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 enable(): PromiseInterface
29
	{
30
		return $this->client->getConfiguration()->getGuzzle()->sendAsync(
31
			new Request('POST', $this->client->getConfiguration()->getBaseUri() . '/system/executions/enable')
32
		);
33
	}
34
35
	/**
36
	 * @return PromiseInterface
37
	 */
38
	public function disable(): PromiseInterface
39
	{
40
		return $this->client->getConfiguration()->getGuzzle()->sendAsync(
41
			new Request('POST', $this->client->getConfiguration()->getBaseUri() . '/system/executions/disable')
42
		);
43
	}
44
}
45