Issues (58)

Services/AzineMailgunTwigExtension.php (2 issues)

1
<?php
2
3
namespace Azine\MailgunWebhooksBundle\Services;
4
5
use Twig\Extension\AbstractExtension;
6
7
/**
8
 * Class AzineMailgunTwigExtension
9
 * Provides some filters and global variables.
10
 */
11
class AzineMailgunTwigExtension extends AbstractExtension
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function getFilters()
17
    {
18
        return array(
19
            'printArray' => new \Twig_SimpleFilter('printArray', array($this, 'printArray'), array('is_safe' => array('html'))),
20
        );
21
    }
22
23
    /**
24
     * @param array $var
25
     *
26
     * @return mixed
27
     */
28
    public static function printArray(array $var)
29
    {
30
        return var_dump($var);
0 ignored issues
show
Are you sure the usage of var_dump($var) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
Security Debugging Code introduced by
var_dump($var) looks like debug code. Are you sure you do not want to remove it?
Loading history...
31
    }
32
33
    /**
34
     * Returns the name of the extension.
35
     *
36
     * @return string The extension name
37
     */
38
    public function getName()
39
    {
40
        return 'azine_mailgun_webhooks_bundle_twig_extension';
41
    }
42
}
43