Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | class DeviceCodeRepository implements DeviceCodeRepositoryInterface |
||
18 | { |
||
19 | /** |
||
20 | * {@inheritDoc} |
||
21 | */ |
||
22 | public function getNewDeviceCode() |
||
23 | { |
||
24 | return new DeviceCodeEntity(); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * {@inheritDoc} |
||
29 | */ |
||
30 | public function persistNewDeviceCode(DeviceCodeEntityInterface $deviceCodeEntity) |
||
32 | // Some logic to persist a new device code to a database |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * {@inheritDoc} |
||
37 | */ |
||
38 | public function getDeviceCodeEntityByDeviceCode($deviceCode, $grantType, ClientEntityInterface $clientEntity) |
||
39 | { |
||
40 | $deviceCode = new DeviceCodeEntity(); |
||
41 | |||
42 | // The user identifier should be set when the user authenticates on the OAuth server |
||
43 | $deviceCode->setUserIdentifier(1); |
||
44 | |||
45 | return $deviceCode; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritDoc} |
||
50 | */ |
||
51 | public function revokeDeviceCode($codeId) |
||
53 | // Some logic to revoke device code |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * {@inheritDoc} |
||
58 | */ |
||
59 | public function isDeviceCodeRevoked($codeId) |
||
61 | // Some logic to check if a device code has been revoked |
||
62 | } |
||
64 |