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
Push — master ( da90f7...c29a3b )
by Gallice
35s
created

Generic   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 29
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A getElements() 0 4 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Attachment\Structured;
4
5
use Tgallice\FBMessenger\Attachment\Structured;
6
use Tgallice\FBMessenger\Model\Generic\Element;
7
8
class Generic extends Structured
9
{
10
    const TEMPLATE_TYPE = 'generic';
11
12
    /**
13
     * @param Element[] $elements
14
     *
15
     * @throws \InvalidArgumentException
16
     */
17 7
    public function __construct(array $elements)
18
    {
19 7
        if (count($elements) > 10) {
20 1
            throw new \InvalidArgumentException('A generic template can not have more than 10 bubbles');
21
        }
22
23 6
        $this->payload = [
24 6
            'template_type' => self::TEMPLATE_TYPE,
25 6
            'elements' => $elements,
26
        ];
27 6
    }
28
29
    /**
30
     * @return Element[]
31
     */
32 1
    public function getElements()
33
    {
34 1
        return $this->payload['elements'];
35
    }
36
}
37