Completed
Push — develop ( 894c58...40c6b6 )
by greg
02:56
created

NextGameWidget::__construct()   A

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 1
1
<?php
2
3
namespace PlaygroundGame\View\Helper;
4
5
use Zend\View\Helper\AbstractHelper;
6
use Interop\Container\ContainerInterface;
7
8
class NextGameWidget extends AbstractHelper
9
{
10
    /**
11
     * @var GameService
12
     */
13
    protected $gameService;
14
15
    public function __construct(\PlaygroundGame\Service\Game $gameService) 
16
    {
17
        return $this->gameService = $gameService;
0 ignored issues
show
Documentation Bug introduced by
It seems like $gameService of type object<PlaygroundGame\Service\Game> is incompatible with the declared type object<PlaygroundGame\View\Helper\GameService> of property $gameService.

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...
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
18
    }
19
20
    /**
21
     * __invoke
22
     *
23
     * @access public
24
     * @param  array  $options array of options
0 ignored issues
show
Bug introduced by
There is no parameter named $options. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
25
     * @return string
26
     */
27
    public function __invoke($dateStart = null, $dateEnd = null, $classType = null, $cost = null, $order = null, $dir = 'DESC')
28
    {
29
        $games = $this->getGameService()->getNextGames($dateStart, $dateEnd, $classType, $cost, $order, $dir);
30
31
        return $games;
32
    }
33
34
    /**
35
     * Get gameService.
36
     *
37
     * @return GameService
38
     */
39
    public function getGameService()
40
    {
41
        return $this->gameService;
42
    }
43
}
44