Scope   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
1
<?php
2
3
namespace Baguette\Mastodon\Service;
4
5
/**
6
 * Scope
7
 *
8
 * @author    USAMI Kenta <[email protected]>
9
 * @copyright 2017 Baguette HQ
10
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0
11
 */
12
class Scope
13
{
14
    /** @var string[] */
15
    private $scopes;
16
17
    /**
18
     * @param string[] $scopes
19
     */
20 5
    public function __construct(array $scopes)
21
    {
22 5
        sort($scopes);
23 5
        $this->scopes = $scopes;
24 5
    }
25
26
    public function __toString()
27
    {
28
        return implode(' ', $this->scopes);
29
    }
30
}
31