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.

GreetingText   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 37
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getText() 0 4 1
A jsonSerialize() 0 6 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\ThreadSetting;
4
5
use Tgallice\FBMessenger\Model\ThreadSetting;
6
7
class GreetingText implements ThreadSetting, \JsonSerializable
8
{
9
    /**
10
     * @var string
11
     */
12
    private $text;
13
14
    /**
15
     * @param string $text
16
     */
17 5
    public function __construct($text)
18
    {
19 5
        if (mb_strlen($text) > 160) {
20 1
            throw new \InvalidArgumentException('The greeting text should not exceed 160 characters.');
21
        }
22
23 4
        $this->text = $text;
24 4
    }
25
26
    /**
27
     * return array
28
     */
29 1
    public function getText()
30
    {
31 1
        return $this->text;
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37 2
    public function jsonSerialize()
38
    {
39
        return [
40 2
            'text' => $this->text,
41 2
        ];
42
    }
43
}
44