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::getElements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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