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::archive()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
}