Scope::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace CodexShaper\OAuth2\Server\Entities;
4
5
use League\OAuth2\Server\Entities\ScopeEntityInterface;
6
use League\OAuth2\Server\Entities\Traits\EntityTrait;
7
8
class Scope implements ScopeEntityInterface
9
{
10
    use EntityTrait;
11
12
    /**
13
     * Create a new scope instance.
14
     *
15
     * @param string $name
16
     *
17
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
18
     */
19
    public function __construct($name)
20
    {
21
        $this->setIdentifier($name);
22
    }
23
24
    /**
25
     * Get the data that should be serialized to JSON.
26
     *
27
     * @return mixed
28
     */
29
    public function jsonSerialize()
30
    {
31
        return $this->getIdentifier();
32
    }
33
}
34