Passed
Push — master ( a73698...779072 )
by Alex
06:49 queued 13s
created

ToolRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A locations() 0 3 1
A location() 0 5 1
A locationUpdate() 0 5 1
A locationDrop() 0 5 1
A locationCreate() 0 3 1
1
<?php
2
3
namespace Axsor\PhpIPAM\Http\Requests;
4
5
class ToolRequest extends Connector
6
{
7
    public function locations()
8
    {
9
        return $this->get('tools/locations');
10
    }
11
12
    public function location($location)
13
    {
14
        $id = get_id_from_variable($location);
15
16
        return $this->get("tools/locations/{$id}");
17
    }
18
19
    public function locationCreate(array $location)
20
    {
21
        return $this->post("tools/locations", $location);
22
    }
23
24
    public function locationUpdate($location, array $newData)
25
    {
26
        $id = get_id_from_variable($location);
27
28
        return $this->patch("tools/locations/{$id}", $newData);
29
    }
30
31
    public function locationDrop($location)
32
    {
33
        $id = get_id_from_variable($location);
34
35
        return $this->delete("tools/locations/{$id}");
36
    }
37
}
38