Code Duplication    Length = 36-36 lines in 2 locations

src/View/Helper/NextGamesWidget.php 1 location

@@ 8-43 (lines=36) @@
5
use Zend\View\Helper\AbstractHelper;
6
use Interop\Container\ContainerInterface;
7
8
class NextGamesWidget 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;
18
    }
19
20
    /**
21
     * __invoke
22
     *
23
     * @access public
24
     * @param  array  $options array of options
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

src/View/Helper/NextGameWidget.php 1 location

@@ 8-43 (lines=36) @@
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;
18
    }
19
20
    /**
21
     * __invoke
22
     *
23
     * @access public
24
     * @param  array  $options array of options
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