GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RestfulTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 44
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A find() 0 4 1
A create() 0 4 1
A update() 0 4 1
A delete() 0 4 1
1
<?php namespace Rossedman\Teamwork\Traits;
2
3
trait RestfulTrait {
4
5
    /**
6
     * @return mixed
7
     */
8
    public function all()
9
    {
10
        return $this->client->get($this->endpoint)->response();
0 ignored issues
show
Bug introduced by
The property client does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
Bug introduced by
The property endpoint does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
11
    }
12
13
    /**
14
     * @return mixed
15
     */
16
    public function find()
17
    {
18
        return $this->client->get("$this->endpoint/$this->id")->response();
0 ignored issues
show
Bug introduced by
The property id does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
19
    }
20
21
    /**
22
     * @return array | companyID
23
     */
24
    public function create($data)
25
    {
26
        return $this->client->post("$this->endpoint", [$this->wrapper => $data])->response();
0 ignored issues
show
Bug introduced by
The property wrapper does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
27
    }
28
29
    /**
30
     * @return mixed
31
     */
32
    public function update($data)
33
    {
34
        return $this->client->put("$this->endpoint/$this->id", [$this->wrapper => $data])->response();
35
    }
36
37
    /**
38
     * @return mixed
39
     */
40
    public function delete()
41
    {
42
        return $this->client->delete("$this->endpoint/$this->id")->response();
43
    }
44
45
46
}