Code Duplication    Length = 12-13 lines in 2 locations

src/Entity/OAuth/Repository/AccessTokenRepository.php 1 location

@@ 16-28 (lines=13) @@
13
     * @param $oauthToken
14
     * @return null|array
15
     */
16
    public function getAccessToken($oauthToken)
17
    {
18
        /** @var AccessToken $token */
19
        $token = $this->findOneBy(['token' => $oauthToken]);
20
        if ($token instanceof AccessToken) {
21
            $array = (array) $token->toArray();
22
            /** @var DateTime $date */
23
            $date = $array['expires'];
24
            $array['expires'] = $date->getTimestamp();
25
            return $array;
26
        }
27
        return null;
28
    }
29
30
    /**
31
     * @param string $oauthToken

src/Entity/OAuth/Repository/AuthCodeRepository.php 1 location

@@ 15-26 (lines=12) @@
12
     * @param $code
13
     * @return null|array
14
     */
15
    public function getAuthorizationCode($code)
16
    {
17
        $authCode = $this->findOneBy(['code' => $code]);
18
        if ($authCode) {
19
            $authCode = $authCode->toArray();
20
            /** @var DateTime $date */
21
            $date = $authCode['expires'];
22
            $authCode['expires'] = $date->getTimestamp();
23
            return $authCode;
24
        }
25
        return null;
26
    }
27
28
    /**
29
     * @param $code