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

AbstractArticleAuthorAdminListConfigurator.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\ArticleBundle\AdminList;
4
5
use Doctrine\ORM\EntityManager;
6
use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper;
7
use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator;
8
use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM\StringFilterType;
9
10
/**
11
 * The AdminList configurator for the AbstractArticleAuthor
12
 */
13
class AbstractArticleAuthorAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $locale;
19
20
    /**
21
     * @var string
22
     */
23
    protected $permission;
24
25
    /**
26
     * @param EntityManager $em        The entity manager
27
     * @param AclHelper     $aclHelper The ACL helper
28
     * @param string        $locale    The current locale
29
     */
30 2
    public function __construct(EntityManager $em, AclHelper $aclHelper, $locale)
31
    {
32 2
        parent::__construct($em, $aclHelper);
33 2
        $this->locale = $locale;
34 2
    }
35
36
    /**
37
     * Return current bundle name.
38
     *
39
     * @return string
40
     */
41 1
    public function getBundleName()
42
    {
43 1
        return 'KunstmaanArticleBundle';
44
    }
45
46
    /**
47
     * Return current entity name.
48
     *
49
     * @return string
50
     */
51 1
    public function getEntityName()
52
    {
53 1
        return 'AbstractArticleAuthor';
54
    }
55
56
    /**
57
     * Configure filters
58
     */
59 1
    public function buildFilters()
60
    {
61 1
        $this->addFilter('name', new StringFilterType('name'), 'article.author.list.filter.name');
62 1
        $this->addFilter('link', new StringFilterType('link'), 'article.author.list.filter.link');
63 1
    }
64
65
    /**
66
     * Configure the visible columns
67
     */
68 1
    public function buildFields()
69
    {
70 1
        $this->addField('name', 'article.author.list.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...
71 1
        $this->addField('link', 'article.author.list.header.link', 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...
72 1
    }
73
}
74