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.

Item   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 36
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setMessage() 0 4 1
A addReference() 0 4 1
A __toString() 0 15 1
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Support\Changelog;
9
10
class Item
11
{
12
    /** @var string */
13
    private $message;
14
15
    /**
16
     * @var int[]
17
     */
18
    private $references = [];
19
20 1
    public function __toString()
21
    {
22 1
        sort($this->references, SORT_NUMERIC);
23
24
        $references = implode('', array_map(function ($ref) {
25 1
            return " [#$ref]";
26 1
        }, $this->references));
27
28 1
        $message = ucfirst($this->message);
29 1
        $message = rtrim($message, '.') . '.';
30 1
        $message = preg_replace('/^Fix /', 'Fixed ', $message);
31 1
        $message = preg_replace('/^Add /', 'Added ', $message);
32
33 1
        return "$message$references";
34
    }
35
36 2
    public function setMessage(string $message)
37
    {
38 2
        $this->message = $message;
39 2
    }
40
41 2
    public function addReference(int $reference)
42
    {
43 2
        $this->references[] = $reference;
44 2
    }
45
}
46