Execution::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Rundeck\Resources;
4
5
use Rundeck\HttpClient;
6
7
/**
8
 * Class Execution /api/V/execution/
9
 * @package Rundeck\Resources
10
 */
11
class Execution extends Resource
12
{
13
14
    protected $actions = [
15
        "abort" => ["xml"], // /api/V/execution/[ID]/abort
16
        "output" => ["xml"], // /api/V/execution/[ID]/output
17
        "output/state" => ["xml"], // /api/V/execution/[ID]/output/state
18
        "state" => ["xml"], // /api/V/execution/[ID]/state
19
        "input/files" => ["xml"], // /api/V/execution/[ID]/input/files
20
    ];
21
22
    /**
23
     * @param HttpClient $client
24
     * @param string $name : Execution ID
25
     */
26 21
    public function __construct(HttpClient $client, $name = null)
27
    {
28 21
        $this->name = $name;
29 21
        $this->client = $client;
30 21
    }
31
32
    /**
33
     * Find execution info by ID
34
     * @param string $alt
35
     * @return mixed
36
     */
37 3
    public function find($alt = "xml")
38
    {
39 3
        $response = $this->client->get('/execution/'.$this->name, $alt);
40 3
        return $response;
41
    }
42
}
43