Passed
Push — develop ( b3005b...339429 )
by BENARD
04:28
created

CanAskProof   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 3 1
1
<?php
2
3
namespace VideoGamesRecords\CoreBundle\Controller\Player\ProofRequest;
4
5
use Doctrine\ORM\NonUniqueResultException;
6
use Doctrine\ORM\NoResultException;
7
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8
use VideoGamesRecords\CoreBundle\DataProvider\CanAskProofProvider;
9
use VideoGamesRecords\CoreBundle\Entity\Player;
10
11
12
class CanAskProof extends AbstractController
13
{
14
    private CanAskProofProvider $canAskProofProvider;
15
16
    public function __construct(CanAskProofProvider $canAskProofProvider)
17
    {
18
        $this->canAskProofProvider = $canAskProofProvider;
19
    }
20
21
    /**
22
     * @param Player $player
23
     * @return bool
24
     * @throws NoResultException
25
     * @throws NonUniqueResultException
26
     */
27
    public function __invoke(Player $player): bool
28
    {
29
        return $this->canAskProofProvider->load($player);
30
    }
31
}
32