Passed
Pull Request — master (#17)
by
unknown
04:51
created

CircuitRequest   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 create() 0 3 1
A update() 0 5 1
A index() 0 3 1
A drop() 0 5 1
A show() 0 5 1
1
<?php
2
3
namespace Axsor\PhpIPAM\Http\Requests;
4
5
class CircuitRequest extends Connector
6
{
7
    public function index()
8
    {
9
        return $this->get('circuits');
10
    }
11
12
    public function show($circuit)
13
    {
14
        $id = get_id_from_variable($circuit);
15
16
        return $this->get("circuits/{$id}");
17
    }
18
19
    public function create(array $circuit)
20
    {
21
        return $this->post('circuits', $circuit);
22
    }
23
24
    public function update($circuit, array $newData)
25
    {
26
        $id = get_id_from_variable($circuit);
27
28
        return $this->patch("circuits/{$id}", $newData);
29
    }
30
31
    public function drop($circuit)
32
    {
33
        $id = get_id_from_variable($circuit);
34
35
        return $this->delete("circuits/{$id}");
36
    }
37
}
38