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.

HasButtons   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buttons() 0 10 2
1
<?php
2
3
namespace NotificationChannels\Facebook\Traits;
4
5
use NotificationChannels\Facebook\Exceptions\CouldNotCreateMessage;
6
7
/**
8
 * Trait HasButtons.
9
 */
10
trait HasButtons
11
{
12
    /** @var array Call to Action Buttons */
13
    protected $buttons = [];
14
15
    /**
16
     * Add up to 3 call to action buttons.
17
     *
18
     * @param  array  $buttons
19
     *
20
     * @throws CouldNotCreateMessage
21
     * @return $this
22
     */
23
    public function buttons(array $buttons = []): self
24
    {
25
        if (count($buttons) > 3) {
26
            throw CouldNotCreateMessage::messageButtonsLimitExceeded();
27
        }
28
29
        $this->buttons = $buttons;
30
31
        return $this;
32
    }
33
}
34