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.

Message   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A archive() 0 4 1
A unarchive() 0 4 1
1
<?php
2
3
namespace Ciromattia\Teamwork;
4
5
use Ciromattia\Teamwork\Traits\RestfulTrait;
6
7
class Message extends TeamworkObject
8
{
9
    use RestfulTrait;
10
11
    protected $wrapper = 'post';
12
    protected $endpoint = 'posts';
13
14
    /**
15
     * Create Message
16
     * POST /projects/{project_id}/posts.json
17
     *
18
     * The RestfulTrait must be overwritten because messages
19
     * require a project to be associated with.
20
     *
21
     * $teamwork->message($projectID)->create([$data]);
22
     *
23
     * @retun mixed
24
     */
25
    public function create($data)
26
    {
27
        return $this->client->post("projects/$this->id/posts", [$this->wrapper => $data])->response();
28
    }
29
30
    /**
31
     * Archive Message
32
     * PUT /messages/{id}/archive.json
33
     */
34
    public function archive()
35
    {
36
        return $this->client->put("messages/$this->id/archive")->response();
37
    }
38
39
    /**
40
     * Unarchive Message
41
     * PUT /messages/{id}/unarchive.json
42
     */
43
    public function unarchive()
44
    {
45
        return $this->client->put("messages/$this->id/unarchive")->response();
46
    }
47
}