GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 61-61 lines in 2 locations

src/AuthCode/AuthCodeRepository.php 1 location

@@ 12-72 (lines=61) @@
9
use League\OAuth2\Server\Entities\AuthCodeEntityInterface;
10
use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;
11
12
class AuthCodeRepository implements AuthCodeRepositoryInterface
13
{
14
	/**
15
	 * @var EntityManager
16
	 */
17
	private $entityManager;
18
19
	/**
20
	 * @var EntityRepository
21
	 */
22
	private $repository;
23
24
	public function __construct(EntityManager $entityManager)
25
	{
26
		$this->entityManager = $entityManager;
27
		$this->repository = $entityManager->getRepository(AuthCodeEntity::class);
28
	}
29
30
	/**
31
	 * @return AuthCodeEntityInterface
32
	 */
33
	public function getNewAuthCode()
34
	{
35
		return new AuthCodeEntity();
36
	}
37
38
	/**
39
	 * @param AuthCodeEntityInterface $authCodeEntity
40
	 */
41
	public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity)
42
	{
43
		$this->entityManager->persist($authCodeEntity);
44
		$this->entityManager->flush();
45
	}
46
47
	/**
48
	 * @param string $codeId
49
	 */
50
	public function revokeAuthCode($codeId)
51
	{
52
		$this->repository->fetchOne($this->createQuery()->byIdentifier($codeId))->setRevoked(true);
53
		$this->entityManager->flush();
54
	}
55
56
	/**
57
	 * @param string $codeId
58
	 * @return bool
59
	 */
60
	public function isAuthCodeRevoked($codeId)
61
	{
62
		return $this->repository->fetchOne($this->createQuery()->byIdentifier($codeId))->isRevoked();
63
	}
64
65
	/**
66
	 * @return QueryObject
67
	 */
68
	protected function createQuery(): QueryObject
69
	{
70
		return new AuthCodeQuery();
71
	}
72
}
73

src/RefreshToken/RefreshTokenRepository.php 1 location

@@ 12-72 (lines=61) @@
9
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
10
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
11
12
class RefreshTokenRepository implements RefreshTokenRepositoryInterface
13
{
14
	/**
15
	 * @var EntityManager
16
	 */
17
	private $entityManager;
18
19
	/**
20
	 * @var EntityRepository
21
	 */
22
	private $repository;
23
24
	public function __construct(EntityManager $entityManager)
25
	{
26
		$this->entityManager = $entityManager;
27
		$this->repository = $entityManager->getRepository(RefreshTokenEntity::class);
28
	}
29
30
	/**
31
	 * @return RefreshTokenEntity
32
	 */
33
	public function getNewRefreshToken()
34
	{
35
		return new RefreshTokenEntity();
36
	}
37
38
	/**
39
	 * @param RefreshTokenEntityInterface $refreshTokenEntity
40
	 */
41
	public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity)
42
	{
43
		$this->entityManager->persist($refreshTokenEntity);
44
		$this->entityManager->flush();
45
	}
46
47
	/**
48
	 * @param string $tokenId
49
	 */
50
	public function revokeRefreshToken($tokenId)
51
	{
52
		$this->repository->fetchOne($this->createQuery()->byIdentifier($tokenId))->setRevoked(true);
53
		$this->entityManager->flush();
54
	}
55
56
	/**
57
	 * @param string $tokenId
58
	 * @return bool
59
	 */
60
	public function isRefreshTokenRevoked($tokenId)
61
	{
62
		return $this->repository->fetchOne($this->createQuery()->byIdentifier($tokenId))->isRevoked();
63
	}
64
65
	/**
66
	 * @return QueryObject
67
	 */
68
	protected function createQuery(): QueryObject
69
	{
70
		return new RefreshTokenQuery();
71
	}
72
}
73