Completed
Push — master ( e6c0c9...d841f8 )
by Jeroen
35:52 queued 19:21
created

AdminList/GroupAdminListConfigurator.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\UserManagementBundle\AdminList;
4
5
use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM\StringFilterType;
6
7
/**
8
 * Group admin list configurator used to manage {@link Group} in the admin
9
 */
10 View Code Duplication
class GroupAdminListConfigurator extends AbstractSettingsAdminListConfigurator
11
{
12
    /**
13
     * Build filters for admin list
14
     */
15
    public function buildFilters()
16
    {
17
        $this->addFilter('name', new StringFilterType('name'), 'kuma_user.group.adminlist.filter.name');
18
    }
19
20
    /**
21
     * Configure the visible columns
22
     */
23
    public function buildFields()
24
    {
25
        $this->addField('name', 'kuma_user.group.adminlist.header.name', true);
0 ignored issues
show
true is of type boolean, but the function expects a string.

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...
26
        $this->addField('roles', 'kuma_user.group.adminlist.header.roles', false);
0 ignored issues
show
false is of type boolean, but the function expects a string.

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...
27
    }
28
29
    /**
30
     * Get repository name
31
     *
32
     * @return string
33
     */
34
    public function getEntityName()
35
    {
36
        return 'Group';
37
    }
38
}
39