Completed
Push — master ( 794574...c83386 )
by greg
11:38 queued 07:13
created

Module::populateCmsCategories()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4286
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
/**
3
 * dependency Core
4
 * @author gbesson
5
 *
6
 */
7
namespace PlaygroundGame;
8
9
use Zend\ModuleManager\ModuleManager;
10
use Zend\Mvc\ModuleRouteListener;
11
use Zend\Mvc\MvcEvent;
12
use Zend\Validator\AbstractValidator;
13
14
class Module
15
{
16
    public function init(ModuleManager $manager)
17
    {
18
        $eventManager = $manager->getEventManager();
19
    
20
        /*
21
         * This event change the config before it's cached
22
        * The change will apply to 'template_path_stack' and 'assetic_configuration'
23
        * These 2 config take part in the Playground Theme Management
24
        */
25
        $eventManager->attach(\Zend\ModuleManager\ModuleEvent::EVENT_MERGE_CONFIG, array($this, 'onMergeConfig'), 50);
26
    }
27
    
28
    /**
29
     * This method is called only when the config is not cached.
30
     * @param \Zend\ModuleManager\ModuleEvent $e
31
     */
32
    public function onMergeConfig(\Zend\ModuleManager\ModuleEvent $e)
33
    {
34
        $config = $e->getConfigListener()->getMergedConfig(false);
35
        
36
        if (isset($config['design']) && isset($config['design']['frontend'])) {
37
            $parentTheme = array($config['design']['frontend']['package'], $config['design']['frontend']['theme']);
38
        } else {
39
            $parentTheme = array('playground','base');
40
        }
41
    
42
        // If custom games need a specific route. I create these routes
43
        if (PHP_SAPI !== 'cli') {
44
            if (isset($config['custom_games'])) {
45
                foreach ($config['custom_games'] as $k => $v) {
46
                    // add custom language directory
47
                    $config['translator']['translation_file_patterns'][] = array(
48
                        'type' => 'phpArray',
49
                        'base_dir' => __DIR__ . '/../../../../../design/frontend/'. $parentTheme[0] .
50
                            '/'. $parentTheme[1] . '/custom/' . $k . '/language',
51
                        'pattern' => '%s.php',
52
                        'text_domain' => $k
53
                    );
54
55
                    // create routes
56
                    if (isset($v['url'])) {
57
                        if (!is_array($v['url'])) {
58
                            $v['url'] = array($v['url']);
59
                        }
60
                        foreach ($v['url'] as $url) {
61
                            // I take the url model of the game type
62
                            if (isset($config['router']['routes']['frontend']['child_routes'][$v['classType']])) {
63
                                $routeModel = $config['router']['routes']['frontend']['child_routes'][$v['classType']];
64
                    
65
                                // Changing the root of the route
66
                                $routeModel['options']['route'] = '/';
67
                    
68
                                // and removing the trailing slash for each subsequent route
69
                                foreach ($routeModel['child_routes'] as $id => $ar) {
70
                                    $routeModel['child_routes'][$id]['options']['route'] = ltrim(
71
                                        $ar['options']['route'],
72
                                        '/'
73
                                    );
74
                                }
75
                    
76
                                // then create the hostname route + appending the model updated
77
                                $config['router']['routes']['frontend.'.$url] = array(
78
                                    'type' => 'Zend\Mvc\Router\Http\Hostname',
79
                                    'options' => array(
80
                                        'route' => $url,
81
                                        'defaults' => array(
82
                                            'id' => $k
83
                                        )
84
                                    ),
85
                                    'may_terminate' => true
86
                                );
87
                                $config['router']['routes']['frontend.'.$url]['child_routes'][$v['classType']] = $routeModel;
88
                                
89
                                // adding not-found catchall : Any non existent URL will be catched by this controller
90
                                $config['router']['routes']['frontend.'.$url]['child_routes'][$v['classType']]['child_routes']['catchall'] = array(
91
                                    'type' => '\Zend\Mvc\Router\Http\Regex',
92
                                    'priority' => -1000,
93
                                    'options' => array(
94
                                        'regex' => '.*',
95
                                        'spec' => '%url%',
96
                                        'defaults' => array(
97
                                            'controller' => 'playgroundgame_'.$v['classType'],
98
                                            'action' => 'not-found'
99
                                        ),
100
                                    ),
101
                                );
102
                    
103
                                $coreLayoutModel = isset($config['core_layout']['frontend'])?
104
                                    $config['core_layout']['frontend']:
105
                                    [];
106
                                $config['core_layout']['frontend.'.$url] = $coreLayoutModel;
107
                            }
108
                        }
109
                    }
110
                    if (isset($v['assetic_configuration'])) {
111
                        foreach ($v['assetic_configuration']['modules'] as $m => $d) {
112
                            $v['assetic_configuration']['modules'][$m]['root_path'][] = __DIR__ .
113
                                '/../../../../../design/frontend/'. $parentTheme[0] .'/'. $parentTheme[1] .
114
                                '/custom/' . $k . '/assets';
115
                        }
116
                        
117
                        // I specialize the route config to the game !
118
                        if (isset($v['assetic_configuration']['routes'])) {
119
                            $customRoutes = array();
120
                            if (isset($v['assetic_configuration']['routes']['params'])) {
121
                                $customRoutes['custom'][$k]['params'] = $v['assetic_configuration']['routes']['params'];
122
                                unset($v['assetic_configuration']['routes']['params']);
123
                            }
124
                            $customRoutes['custom'][$k]['params']['id'] = $k;
125
                            $customRoutes['custom'][$k]['routes'] = $v['assetic_configuration']['routes'];
126
                            $v['assetic_configuration']['routes'] = $customRoutes;
127
                        }
128
                        
129
                        $config['assetic_configuration'] = array_replace_recursive(
130
                            $config['assetic_configuration'],
131
                            $v['assetic_configuration']
132
                        );
133
                    }
134
                }
135
            }
136
        }
137
138
        $e->getConfigListener()->setMergedConfig($config);
139
    }
140
            
141
    public function onBootstrap(MvcEvent $e)
142
    {
143
        $serviceManager = $e->getApplication()->getServiceManager();
144
145
        $options = $serviceManager->get('playgroundcore_module_options');
146
        $locale = $options->getLocale();
147
        $translator = $serviceManager->get('translator');
148
        if (!empty($locale)) {
149
            //translator
150
            $translator->setLocale($locale);
151
152
            // plugins
153
            $translate = $serviceManager->get('viewhelpermanager')->get('translate');
154
            $translate->getTranslator()->setLocale($locale);
155
        }
156
157
        AbstractValidator::setDefaultTranslator($translator, 'playgroundcore');
158
159
        $eventManager        = $e->getApplication()->getEventManager();
160
        $moduleRouteListener = new ModuleRouteListener();
161
        $moduleRouteListener->attach($eventManager);
162
163
        // If PlaygroundCms is installed, I can add my own dynareas to benefit from this feature
164
        $e->getApplication()->getEventManager()->getSharedManager()->attach(
165
            'Zend\Mvc\Application',
166
            'getDynareas',
167
            array($this, 'updateDynareas')
168
        );
169
170
        // I can post cron tasks to be scheduled by the core cron service
171
        $e->getApplication()->getEventManager()->getSharedManager()->attach(
172
            'Zend\Mvc\Application',
173
            'getCronjobs',
174
            array($this, 'addCronjob')
175
        );
176
177
        // If PlaygroundCms is installed, I can add game categories
178
        $e->getApplication()->getEventManager()->getSharedManager()->attach(
179
            'Zend\Mvc\Application',
180
            'getCmsCategories',
181
            array($this, 'populateCmsCategories')
182
        );
183
184
        // If cron is called, the $e->getRequest()->getPost() produces an error so I protect it with
185
        // this test
186
        if ((get_class($e->getRequest()) == 'Zend\Console\Request')) {
187
            return;
188
        }
189
            
190
        /**
191
         * This listener gives the possibility to select the layout on module / controller / action level
192
         * This is triggered after the PlaygroundDesign one so that it's the last triggered for games.
193
         */
194
        $e->getApplication()->getEventManager()->getSharedManager()->attach(
195
            'Zend\Mvc\Controller\AbstractActionController',
196
            'dispatch',
197
            function (MvcEvent $e) {
198
                $config     = $e->getApplication()->getServiceManager()->get('config');
199
                if (isset($config['core_layout'])) {
200
                    $controller      = $e->getTarget();
201
                    $controllerClass = get_class($controller);
202
                    $moduleName      = strtolower(substr($controllerClass, 0, strpos($controllerClass, '\\')));
203
                    $match           = $e->getRouteMatch();
204
                    $routeName       = $match->getMatchedRouteName();
205
                    $areaName        = (strpos($routeName, '/'))?
206
                        substr($routeName, 0, strpos($routeName, '/')):
207
                        $routeName;
208
                    $areaName        = (strpos($areaName, '.'))?substr($areaName, 0, strpos($areaName, '.')):$areaName;
209
                    $areaName        = ($areaName == 'frontend' || $areaName == 'admin')? $areaName : 'frontend';
210
                    $controllerName  = $match->getParam('controller', 'not-found');
211
                    $actionName      = $match->getParam('action', 'not-found');
212
                    $slug            = $match->getParam('id', '');
213
                    $viewModel       = $e->getViewModel();
214
215
                    /**
216
                     * Assign the correct layout
217
                    */
218
                    if (!empty($slug)) {
219
                        if (isset($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['actions'][$actionName]['layout'])) {
220
                            $controller->layout($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['actions'][$actionName]['layout']);
221
                        } elseif (isset($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['layout'])) {
222
                            $controller->layout($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['layout']);
223
                        } elseif (isset($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['layout'])) {
224
                            $controller->layout($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['layout']);
225
                        } elseif (isset($config['custom_games'][$slug]['core_layout'][$areaName]['layout'])) {
226
                            $controller->layout($config['custom_games'][$slug]['core_layout'][$areaName]['layout']);
227
                        }
228
                
229
230
                        // the area needs to be updated if I'm in a custom game for frontendUrl to work
231
                        if (isset($config['custom_games'][$slug])) {
232
                            $url = (is_array($config['custom_games'][$slug]['url']))?
233
                                $config['custom_games'][$slug]['url']:
234
                                array($config['custom_games'][$slug]['url']);
235
                            $from = strtolower($e->getRequest()->getUri()->getHost());
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface Zend\Stdlib\RequestInterface as the method getUri() does only exist in the following implementations of said interface: Zend\Http\PhpEnvironment\Request, Zend\Http\Request.

Let’s take a look at an example:

interface User
{
    /** @return string */
    public function getPassword();
}

class MyUser implements User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the interface:

    interface User
    {
        /** @return string */
        public function getPassword();
    
        /** @return string */
        public function getDisplayName();
    }
    
Loading history...
236
                            $areaName = ($areaName === 'frontend' && in_array($from, $url))? $areaName.'.'.$from:$areaName;
237
                        }
238
                        // I add this area param so that it can be used by Controller plugin frontendUrl
239
                        // and View helper frontendUrl
240
                        $match->setParam('area', $areaName);
241
                        /**
242
                         * Create variables attached to layout containing path views
243
                         * cascading assignment is managed
244
                         */
245
                        if (isset($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['children_views'])) {
246
                            foreach ($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['children_views'] as $k => $v) {
247
                                $viewModel->$k  = $v;
248
                            }
249
                        }
250
                        if (isset($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['children_views'])) {
251 View Code Duplication
                            foreach ($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['children_views'] as $k => $v) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
252
                                $viewModel->$k  = $v;
253
                            }
254
                        }
255
                        if (isset($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['actions'][$actionName]['children_views'])) {
256 View Code Duplication
                            foreach ($config['custom_games'][$slug]['core_layout'][$areaName]['modules'][$moduleName]['controllers'][$controllerName]['actions'][$actionName]['children_views'] as $k => $v) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
257
                                $viewModel->$k  = $v;
258
                            }
259
                        }
260
                    }
261
                }
262
            },
263
            10
264
        );
265
    }
266
267
    /**
268
     * This method get the games and add them as Dynareas to PlaygroundCms
269
     * so that blocks can be dynamically added to the games.
270
     *
271
     * @param  MvcEvent $e
272
     * @return array
273
     */
274
    public function updateDynareas(\Zend\EventManager\Event $e)
275
    {
276
        $dynareas = $e->getParam('dynareas');
277
278
        $gameService = $e->getTarget()->getServiceManager()->get('playgroundgame_game_service');
279
280
        $games = $gameService->getActiveGames();
281
282
        foreach ($games as $game) {
283
            $array = array(
284
                'game'.$game->getId() => array(
285
                    'title' => $game->getTitle(),
286
                    'description' => $game->getClassType(),
287
                    'location'=>'pages du jeu'
288
                )
289
            );
290
            $dynareas = array_merge($dynareas, $array);
291
        }
292
293
        return $dynareas;
294
    }
295
296
    /**
297
     * This method add the games to the cms categories of pages
298
     * not that satisfied neither
299
     *
300
     * @param  EventManager $e
301
     * @return array
302
     */
303
    public function populateCmsCategories ($e)
304
    {
305
        $catsArray = $e->getParam('categories');
306
307
        $gameService = $e->getTarget()->getServiceManager()->get('playgroundgame_game_service');
308
        $games = $gameService->getActiveGames(false);
309
310
        foreach ($games as $game) {
311
            $catsArray[$game->getIdentifier()] = 'Pg Game - ' . $game->getIdentifier();
312
        }
313
314
        return $catsArray;
315
    }
316
317
    /**
318
     * This method get the cron config for this module an add them to the listener
319
     *
320
     * @param  MvcEvent $e
321
     * @return array
322
     */
323
    public function addCronjob(\Zend\EventManager\Event $e)
324
    {
325
        $cronjobs = $e->getParam('cronjobs');
326
327
        $cronjobs['adfagame_email'] = array(
328
            'frequency' => '*/15 * * * *',
329
            'callback'  => '\PlaygroundGame\Service\Cron::cronMail',
330
            'args'      => array('bar', 'baz'),
331
        );
332
333
        // tous les jours à 5:00 AM
334
        $cronjobs['adfagame_instantwin_email'] = array(
335
                'frequency' => '* 5 * * *',
336
                'callback'  => '\PlaygroundGame\Service\Cron::instantWinEmail',
337
                'args'      => array(),
338
        );
339
340
        return $cronjobs;
341
    }
342
343
    public function getConfig()
344
    {
345
        return include __DIR__ . '/../../config/module.config.php';
346
    }
347
348
    public function getAutoloaderConfig()
349
    {
350
        return array(
351
            'Zend\Loader\StandardAutoloader' => array(
352
                'namespaces' => array(
353
                    __NAMESPACE__ => __DIR__ . '/../../src/' . __NAMESPACE__,
354
                ),
355
            ),
356
        );
357
    }
358
359
    /**
360
     * @return array
361
     */
362
    public function getViewHelperConfig()
363
    {
364
        return array(
365
            'factories' => array(
366
                'playgroundPrizeCategory' => function (\Zend\ServiceManager\ServiceManager $sm) {
367
                    $locator = $sm->getServiceLocator();
0 ignored issues
show
Bug introduced by
It seems like you code against a specific sub-type and not the parent class Zend\ServiceManager\ServiceManager as the method getServiceLocator() does only exist in the following sub-classes of Zend\ServiceManager\ServiceManager: Zend\Barcode\ObjectPluginManager, Zend\Barcode\RendererPluginManager, Zend\Cache\PatternPluginManager, Zend\Cache\Storage\AdapterPluginManager, Zend\Cache\Storage\PluginManager, Zend\Config\ReaderPluginManager, Zend\Config\WriterPluginManager, Zend\Crypt\SymmetricPluginManager, Zend\Crypt\Symmetric\PaddingPluginManager, Zend\Feed\Reader\ExtensionPluginManager, Zend\Feed\Writer\ExtensionPluginManager, Zend\File\Transfer\Adapter\FilterPluginManager, Zend\Filter\FilterPluginManager, Zend\Form\FormElementManager, Zend\I18n\Translator\LoaderPluginManager, Zend\InputFilter\InputFilterPluginManager, Zend\Log\ProcessorPluginManager, Zend\Log\WriterPluginManager, Zend\Log\Writer\FilterPluginManager, Zend\Log\Writer\FormatterPluginManager, Zend\Mail\Protocol\SmtpPluginManager, Zend\Mvc\Controller\ControllerManager, Zend\Mvc\Controller\PluginManager, Zend\Mvc\Router\RoutePluginManager, Zend\Paginator\AdapterPluginManager, Zend\Paginator\ScrollingStylePluginManager, Zend\Permissions\Acl\Assertion\AssertionManager, Zend\Serializer\AdapterPluginManager, Zend\ServiceManager\AbstractPluginManager, Zend\Stdlib\Hydrator\HydratorPluginManager, Zend\Tag\Cloud\DecoratorPluginManager, Zend\Text\Table\DecoratorManager, Zend\Validator\ValidatorPluginManager, Zend\View\HelperPluginManager, Zend\View\Helper\Navigation\PluginManager. Maybe you want to instanceof check for one of these explicitly?

Let’s take a look at an example:

abstract class User
{
    /** @return string */
    abstract public function getPassword();
}

class MyUser extends User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different sub-classes of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the parent class:

    abstract class User
    {
        /** @return string */
        abstract public function getPassword();
    
        /** @return string */
        abstract public function getDisplayName();
    }
    
Loading history...
368
                    $viewHelper = new View\Helper\PrizeCategory;
369
                    $viewHelper->setPrizeCategoryService($locator->get('playgroundgame_prizecategory_service'));
370
371
                    return $viewHelper;
372
                },
373
            ),
374
        );
375
    }
376
377
    public function getServiceConfig()
378
    {
379
        return array(
380
            'aliases' => array(
381
                // An alias for linking a partner service with PlaygroundGame without adherence
382
                'playgroundgame_partner_service' => 'playgroundpartnership_partner_service',
383
                'playgroundgame_message'         => 'playgroundcore_message',
384
385
            ),
386
387
            'invokables' => array(
388
                'playgroundgame_game_service'              => 'PlaygroundGame\Service\Game',
389
                'playgroundgame_lottery_service'           => 'PlaygroundGame\Service\Lottery',
390
                'playgroundgame_postvote_service'          => 'PlaygroundGame\Service\PostVote',
391
                'playgroundgame_quiz_service'              => 'PlaygroundGame\Service\Quiz',
392
                'playgroundgame_instantwin_service'        => 'PlaygroundGame\Service\InstantWin',
393
                'playgroundgame_mission_service'           => 'PlaygroundGame\Service\Mission',
394
                'playgroundgame_prize_service'             => 'PlaygroundGame\Service\Prize',
395
                'playgroundgame_prizecategory_service'     => 'PlaygroundGame\Service\PrizeCategory',
396
                'playgroundgame_prizecategoryuser_service' => 'PlaygroundGame\Service\PrizeCategoryUser',
397
            ),
398
399
            'factories' => array(
400
                'playgroundgame_module_options' => function (\Zend\ServiceManager\ServiceManager $sm) {
401
                        $config = $sm->get('Configuration');
402
403
                        return new Options\ModuleOptions(
404
                            isset($config['playgroundgame']) ? $config['playgroundgame'] : array()
405
                        );
406
                },
407
408
                'playgroundgame_game_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
409
                    $mapper = new \PlaygroundGame\Mapper\Game(
410
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
411
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
412
                    );
413
414
                    return $mapper;
415
                },
416
                
417
                'playgroundgame_playerform_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
418
                    $mapper = new \PlaygroundGame\Mapper\PlayerForm(
419
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
420
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
421
                    );
422
                
423
                    return $mapper;
424
                },
425
426
                'playgroundgame_lottery_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
427
                    $mapper = new \PlaygroundGame\Mapper\Lottery(
428
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
429
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
430
                    );
431
432
                    return $mapper;
433
                },
434
435
                'playgroundgame_instantwin_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
436
                    $mapper = new \PlaygroundGame\Mapper\InstantWin(
437
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
438
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
439
                    );
440
441
                    return $mapper;
442
                },
443
444
                'playgroundgame_instantwinoccurrence_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
445
                    $mapper = new \PlaygroundGame\Mapper\InstantWinOccurrence(
446
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
447
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
448
                    );
449
450
                    return $mapper;
451
                },
452
453
                'playgroundgame_quiz_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
454
                    $mapper = new \PlaygroundGame\Mapper\Quiz(
455
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
456
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
457
                    );
458
459
                    return $mapper;
460
                },
461
462
                'playgroundgame_quizquestion_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
463
                    $mapper = new \PlaygroundGame\Mapper\QuizQuestion(
464
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
465
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
466
                    );
467
468
                    return $mapper;
469
                },
470
471
                'playgroundgame_quizanswer_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
472
                    $mapper = new \PlaygroundGame\Mapper\QuizAnswer(
473
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
474
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
475
                    );
476
477
                    return $mapper;
478
                },
479
480
                'playgroundgame_quizreply_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
481
                    $mapper = new \PlaygroundGame\Mapper\QuizReply(
482
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
483
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
484
                    );
485
486
                    return $mapper;
487
                },
488
489
                'playgroundgame_quizreplyanswer_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
490
                    $mapper = new \PlaygroundGame\Mapper\QuizReplyAnswer(
491
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
492
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
493
                    );
494
495
                    return $mapper;
496
                },
497
498
499
                'playgroundgame_entry_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
500
                    $mapper = new \PlaygroundGame\Mapper\Entry(
501
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
502
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
503
                    );
504
505
                    return $mapper;
506
                },
507
508
                'playgroundgame_postvote_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
509
                    $mapper = new \PlaygroundGame\Mapper\PostVote(
510
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
511
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
512
                    );
513
514
                    return $mapper;
515
                },
516
517
                'playgroundgame_postvoteform_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
518
                    $mapper = new \PlaygroundGame\Mapper\PostVoteForm(
519
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
520
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
521
                    );
522
523
                    return $mapper;
524
                },
525
526
                'playgroundgame_postvotepost_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
527
                    $mapper = new \PlaygroundGame\Mapper\PostVotePost(
528
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
529
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
530
                    );
531
532
                    return $mapper;
533
                },
534
535
                'playgroundgame_postvotepostelement_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
536
                    $mapper = new \PlaygroundGame\Mapper\PostVotePostElement(
537
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
538
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
539
                    );
540
541
                    return $mapper;
542
                },
543
544
                'playgroundgame_postvotevote_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
545
                    $mapper = new \PlaygroundGame\Mapper\PostVoteVote(
546
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
547
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
548
                    );
549
550
                    return $mapper;
551
                },
552
553
                'playgroundgame_prize_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
554
                    $mapper = new \PlaygroundGame\Mapper\Prize(
555
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
556
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
557
                    );
558
559
                    return $mapper;
560
                },
561
562
                'playgroundgame_prizecategory_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
563
                    $mapper = new \PlaygroundGame\Mapper\PrizeCategory(
564
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
565
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
566
                    );
567
568
                    return $mapper;
569
                },
570
571
                'playgroundgame_prizecategoryuser_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
572
                    $mapper = new \PlaygroundGame\Mapper\PrizeCategoryUser(
573
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
574
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
575
                    );
576
577
                    return $mapper;
578
                },
579
580
                'playgroundgame_invitation_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
581
                    $mapper = new \PlaygroundGame\Mapper\Invitation(
582
                        $sm->get('doctrine.entitymanager.orm_default'),
0 ignored issues
show
Documentation introduced by
$sm->get('doctrine.entitymanager.orm_default') is of type object|array, but the function expects a object<Doctrine\ORM\EntityManager>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
583
                        $sm->get('playgroundgame_module_options')
0 ignored issues
show
Documentation introduced by
$sm->get('playgroundgame_module_options') is of type object|array, but the function expects a object<PlaygroundGame\Options\ModuleOptions>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
584
                    );
585
586
                    return $mapper;
587
                },
588
589
                'playgroundgame_mission_mapper' => function ($sm) {
590
                    $mapper = new Mapper\Mission(
591
                        $sm->get('doctrine.entitymanager.orm_default'),
592
                        $sm->get('playgroundgame_module_options')
593
                    );
594
595
                    return $mapper;
596
                },
597
                
598
                'playgroundgame_mission_game_mapper' => function ($sm) {
599
                    $mapper = new Mapper\MissionGame(
600
                        $sm->get('doctrine.entitymanager.orm_default'),
601
                        $sm->get('playgroundgame_module_options')
602
                    );
603
                
604
                    return $mapper;
605
                },
606
                
607
                'playgroundgame_mission_game_condition_mapper' => function ($sm) {
608
                    $mapper = new Mapper\MissionGameCondition(
609
                        $sm->get('doctrine.entitymanager.orm_default'),
610
                        $sm->get('playgroundgame_module_options')
611
                    );
612
                
613
                    return $mapper;
614
                },
615
616
                'playgroundgame_mission_form' => function ($sm) {
617
                    $translator = $sm->get('translator');
618
                    $form = new Form\Admin\Mission(null, $sm, $translator);
619
                    $mission = new Entity\Mission();
620
                    $form->setInputFilter($mission->getInputFilter());
621
622
                    return $form;
623
                },
624
                
625 View Code Duplication
                'playgroundgame_mission_game_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
626
                    $translator = $sm->get('translator');
627
                    $form = new Form\Admin\MissionGameFieldset(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
628
                    $missionGame = new Entity\MissionGame();
629
                    $form->setInputFilter($missionGame->getInputFilter());
0 ignored issues
show
Bug introduced by
The method setInputFilter() does not seem to exist on object<PlaygroundGame\Fo...in\MissionGameFieldset>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
630
                    return $form;
631
                },
632
633 View Code Duplication
                'playgroundgame_game_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
634
                    $translator = $sm->get('translator');
635
                    $form = new Form\Admin\Game(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
636
                    $game = new Entity\Game();
637
                    $form->setInputFilter($game->getInputFilter());
638
639
                    return $form;
640
                },
641
642
                'playgroundgame_register_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
643
                    $translator = $sm->get('translator');
644
                    $zfcUserOptions = $sm->get('zfcuser_module_options');
645
                    $form = new Form\Frontend\Register(null, $zfcUserOptions, $translator, $sm);
0 ignored issues
show
Documentation introduced by
$zfcUserOptions is of type object|array, but the function expects a object<ZfcUser\Options\R...rationOptionsInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
646
                    $form->setInputFilter(new \ZfcUser\Form\RegisterFilter(
647
                        new \ZfcUser\Validator\NoRecordExists(array(
648
                            'mapper' => $sm->get('zfcuser_user_mapper'),
649
                            'key'    => 'email'
650
                        )),
651
                        new \ZfcUser\Validator\NoRecordExists(array(
652
                            'mapper' => $sm->get('zfcuser_user_mapper'),
653
                            'key'    => 'username'
654
                        )),
655
                        $zfcUserOptions
0 ignored issues
show
Documentation introduced by
$zfcUserOptions is of type object|array, but the function expects a object<ZfcUser\Options\R...rationOptionsInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
656
                    ));
657
658
                    return $form;
659
                },
660
661
                'playgroundgame_import_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
662
                    $translator = $sm->get('translator');
663
                    $form = new Form\Admin\Import(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
664
                
665
                    return $form;
666
                },
667
668 View Code Duplication
                'playgroundgame_lottery_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
669
                    $translator = $sm->get('translator');
670
                    $form = new Form\Admin\Lottery(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
671
                    $lottery = new Entity\Lottery();
672
                    $form->setInputFilter($lottery->getInputFilter());
673
674
                    return $form;
675
                },
676
677 View Code Duplication
                'playgroundgame_quiz_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
678
                    $translator = $sm->get('translator');
679
                    $form = new Form\Admin\Quiz(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
680
                    $quiz = new Entity\Quiz();
681
                    $form->setInputFilter($quiz->getInputFilter());
682
683
                    return $form;
684
                },
685
686 View Code Duplication
                'playgroundgame_instantwin_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
687
                    $translator = $sm->get('translator');
688
                    $form = new Form\Admin\InstantWin(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
689
                    $instantwin = new Entity\InstantWin();
690
                    $form->setInputFilter($instantwin->getInputFilter());
691
692
                    return $form;
693
                },
694
695 View Code Duplication
                'playgroundgame_quizquestion_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
696
                    $translator = $sm->get('translator');
697
                    $form = new Form\Admin\QuizQuestion(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
698
                    $quizQuestion = new Entity\QuizQuestion();
699
                    $form->setInputFilter($quizQuestion->getInputFilter());
700
701
                    return $form;
702
                },
703
704 View Code Duplication
                'playgroundgame_instantwinoccurrence_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
705
                    $translator = $sm->get('translator');
706
                    $form = new Form\Admin\InstantWinOccurrence(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
707
                    $instantwinOccurrence = new Entity\InstantWinOccurrence();
708
                    $form->setInputFilter($instantwinOccurrence->getInputFilter());
709
710
                    return $form;
711
                },
712
713
                'playgroundgame_instantwinoccurrenceimport_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
714
                    $translator = $sm->get('translator');
715
                    $form = new Form\Admin\InstantWinOccurrenceImport(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
716
                    return $form;
717
                },
718
719
                'playgroundgame_instantwinoccurrencecode_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
720
                    $translator = $sm->get('translator');
721
                    $form = new Form\Frontend\InstantWinOccurrenceCode(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
722
                    $filter = new Form\Frontend\InstantWinOccurrenceCodeFilter();
723
                    $form->setInputFilter($filter);
724
                    return $form;
725
                },
726
727 View Code Duplication
                'playgroundgame_postvote_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
728
                    $translator = $sm->get('translator');
729
                    $form = new Form\Admin\PostVote(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
730
                    $postVote = new Entity\PostVote();
731
                    $form->setInputFilter($postVote->getInputFilter());
732
733
                    return $form;
734
                },
735
736 View Code Duplication
                'playgroundgame_prizecategory_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
737
                    $translator = $sm->get('translator');
738
                    $form = new Form\Admin\PrizeCategory(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
739
                    $prizeCategory = new Entity\PrizeCategory();
740
                    $form->setInputFilter($prizeCategory->getInputFilter());
741
742
                    return $form;
743
                },
744
745
                'playgroundgame_prizecategoryuser_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
746
                    $translator = $sm->get('translator');
747
                    $form = new Form\Frontend\PrizeCategoryUser(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
748
749
                    return $form;
750
                },
751
752
                'playgroundgame_sharemail_form' => function (\Zend\ServiceManager\ServiceManager $sm) {
753
                    $translator = $sm->get('translator');
754
                    $form = new Form\Frontend\ShareMail(null, $sm, $translator);
0 ignored issues
show
Documentation introduced by
$translator is of type object|array, but the function expects a object<Zend\Mvc\I18n\Translator>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
755
                    $form->setInputFilter(new Form\Frontend\ShareMailFilter());
756
757
                    return $form;
758
                },
759
            ),
760
        );
761
    }
762
}
763