| Total Complexity | 5 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| 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 |