Lottery::getGameEntity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PlaygroundGame\Service;
4
5
use PlaygroundGame\Mapper\GameInterface as GameMapperInterface;
6
7
class Lottery extends Game
8
{
9
    /**
10
     * @var LotteryMapperInterface
11
     */
12
    protected $lotteryMapper;
13
14
    public function subscribeToLottery($game, $user, $entry)
15
    {
16
        $entry->setDrawable(true);
17
        $entry->setActive(false);
18
        $entry = $this->getEntryMapper()->update($entry);
19
20
        $this->getEventManager()->trigger(
21
            __FUNCTION__ . '.post',
22
            $this,
23
            array('user' => $user, 'game' => $game, 'entry' => $entry)
24
        );
25
26
        return $entry;
27
    }
28
29
    public function getGameEntity()
30
    {
31
        return new \PlaygroundGame\Entity\Lottery;
32
    }
33
34
    /**
35
     * getLotteryMapper
36
     *
37
     * @return LotteryMapperInterface
38
     */
39
    public function getLotteryMapper()
40
    {
41
        if (null === $this->lotteryMapper) {
42
            $this->lotteryMapper = $this->serviceLocator->get('playgroundgame_lottery_mapper');
43
        }
44
45
        return $this->lotteryMapper;
46
    }
47
48
    /**
49
     * setLotteryMapper
50
     *
51
     * @param  LotteryMapperInterface $lotteryMapper
52
     * @return Lottery
53
     */
54
    public function setLotteryMapper(GameMapperInterface $lotteryMapper)
55
    {
56
        $this->lotteryMapper = $lotteryMapper;
0 ignored issues
show
Documentation Bug introduced by
It seems like $lotteryMapper of type object<PlaygroundGame\Mapper\GameInterface> is incompatible with the declared type object<PlaygroundGame\Se...LotteryMapperInterface> of property $lotteryMapper.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
57
58
        return $this;
59
    }
60
}
61