Scope   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A jsonSerialize() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Oauth\Bridge;
6
7
use League\OAuth2\Server\Entities\Traits\EntityTrait;
8
use League\OAuth2\Server\Entities\ScopeEntityInterface;
9
10
class Scope implements ScopeEntityInterface
11
{
12
    use EntityTrait;
13
14
    /**
15
     * Create a new scope instance.
16
     *
17
     * @param string $name
18
     *
19
     * @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...
20
     */
21
    public function __construct($name)
22
    {
23
        $this->setIdentifier($name);
24
    }
25
26
    /**
27
     * Get the data that should be serialized to JSON.
28
     *
29
     * @return mixed
30
     */
31
    public function jsonSerialize()
32
    {
33
        return $this->getIdentifier();
34
    }
35
}
36