Completed
Push — master ( 25710f...56c545 )
by Akram
02:12
created

Job   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 32
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A find() 0 5 1
1
<?php
2
3
namespace Rundeck\Resources;
4
5
use Rundeck\HttpClient;
6
7
/**
8
 * Class Job
9
 * @package Rundeck\Resources
10
 */
11
class Job extends Resource
12
{
13
14
    /**
15
     * @var array
16
     */
17
    protected $actions = [
18
        "executions" => ["xml"],
19
        "input/files" => ["xml"],
20
        "info" => ["xml"],
21
    ];
22
23
    /**
24
     * @param HttpClient $client
25
     * @param string $name
26
     */
27 6
    public function __construct(HttpClient $client, $name = null)
28
    {
29 6
        $this->name = $name;
30 6
        $this->client = $client;
0 ignored issues
show
Documentation Bug introduced by
It seems like $client of type object<Rundeck\HttpClient> is incompatible with the declared type object<Rundeck\Resources\HttpClient> of property $client.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31 6
    }
32
33
    /**
34
     * @param string $alt
35
     * @return mixed
36
     */
37 3
    public function find($alt = "xml")
38
    {
39 3
        $response = $this->client->get('/job/'.$this->name, $alt);
40 3
        return $response;
41
    }
42
}
43