Completed
Push — master ( 62e173...8ef644 )
by Christoffer
02:02
created

MockAccessTokenStorage::associateScope()   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 2
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 10 and the first side effect is on line 3.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
require_once 'MockStorage.php';
4
5
use League\OAuth2\Server\Entity\AccessTokenEntity;
6
use League\OAuth2\Server\Entity\ScopeEntity;
7
use League\OAuth2\Server\Exception\AccessDeniedException;
8
use League\OAuth2\Server\Storage\AccessTokenInterface;
9
10
class MockAccessTokenStorage extends MockStorage implements AccessTokenInterface
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public function get($token)
16
    {
17
        $entity = new AccessTokenEntity($this->server);
18
19
        $entity->setId('mF_9.B5f-4.1JqM');
20
        $entity->setExpireTime(time() + 24*60*60); // NOW + 24h
21
22
        return $entity;
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function getScopes(AccessTokenEntity $token)
29
    {
30
        throw new \Exception('Not implemented');
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function create($token, $expireTime, $sessionId)
37
    {
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function associateScope(AccessTokenEntity $token, ScopeEntity $scope)
44
    {
45
        throw new \Exception('Not implemented');
46
    }
47
48
    /**
49
     * @inheritdoc
50
     */
51
    public function delete(AccessTokenEntity $token)
52
    {
53
    }
54
}
55