Airtable   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 46
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A find() 0 4 1
A create() 0 4 1
A update() 0 4 1
A destroy() 0 4 1
A get() 0 4 1
A all() 0 4 1
1
<?php
2
3
namespace Tapp\Airtable;
4
5
class Airtable
6
{
7
    private $api;
8
9
    /** @var string */
10
    protected $base;
11
12
    /** @var string */
13
    protected $table;
14
15
    public function __construct($client, $table)
16
    {
17
        $this->table = $table;
18
        $this->api = $client;
19
    }
20
21
    public function find(string $id)
22
    {
23
        return $this->api->get($id);
24
    }
25
26
    public function create($data)
27
    {
28
        return $this->api->post($data);
29
    }
30
31
    public function update(string $id, $data)
32
    {
33
        return $this->api->put($id, $data);
34
    }
35
36
    public function destroy(string $id)
37
    {
38
        return $this->api->delete($id);
39
    }
40
41
    public function get()
42
    {
43
        return $this->api->get();
44
    }
45
46
    public function all()
47
    {
48
        return $this->api->getAllPages();
49
    }
50
}
51