Passed
Push — master ( de5894...b396dd )
by Conrad
07:34
created

ScopeEntity::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AdvancedLearning\Oauth2Server\Entities;
4
5
use League\OAuth2\Server\Entities\ScopeEntityInterface;
6
use League\OAuth2\Server\Entities\Traits\EntityTrait;
7
8
class ScopeEntity implements ScopeEntityInterface
9
{
10
    use EntityTrait;
11
12
    /**
13
     * ScopeEntity constructor.
14
     *
15
     * @param string $name The name of the scope.
16
     */
17
    public function __construct(string $name)
18
    {
19
        $this->setIdentifier($name);
20
    }
21
22
    /**
23
     * Get the scope in a format suitable for json.
24
     *
25
     * @return mixed
26
     */
27
    public function jsonSerialize()
28
    {
29
        return $this->getIdentifier();
30
    }
31
}
32