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.
Completed
Pull Request — master (#10)
by
unknown
02:43
created

ButtonsTrait::buttons()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php
2
3
namespace NotificationChannels\Facebook\Traits;
4
5
use NotificationChannels\Facebook\Exceptions\CouldNotCreateMessage;
6
7
trait ButtonsTrait
8
{
9
10
    /** @var array Call to Action Buttons */
11
    public $buttons = [];
12
13
    /**
14
     * Add up to 3 call to action buttons.
15
     *
16
     * @param array $buttons
17
     *
18
     * @return $this
19
     * @throws CouldNotCreateMessage
20
     */
21
    public function buttons(array $buttons = [])
22
    {
23
        if (count($buttons) > 3) {
24
            throw CouldNotCreateMessage::messageButtonsLimitExceeded();
25
        }
26
        $this->buttons = $buttons;
27
        return $this;
28
    }
29
30
}