Scope::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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