Passed
Push — master ( cdfcce...65a138 )
by Alex
06:05
created

ToolRequest::tagDrop()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
    public function tags()
39
    {
40
        return $this->get('tools/tags');
41
    }
42
43
    public function tag($tag)
44
    {
45
        $id = get_id_from_variable($tag);
46
47
        return $this->get("tools/tags/{$id}");
48
    }
49
50
    public function tagCreate(array $tag)
51
    {
52
        return $this->post('tools/tags', $tag);
53
    }
54
55
    public function tagUpdate($tag, array $newData)
56
    {
57
        $id = get_id_from_variable($tag);
58
59
        return $this->patch("tools/tags/{$id}", $newData);
60
    }
61
62
    public function tagDrop($tag)
63
    {
64
        $id = get_id_from_variable($tag);
65
66
        return $this->delete("tools/tags/{$id}");
67
    }
68
}
69