for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Azine\MailgunWebhooksBundle\Services;
use Twig\Extension\AbstractExtension;
/**
* Class AzineMailgunTwigExtension
* Provides some filters and global variables.
*/
class AzineMailgunTwigExtension extends AbstractExtension
{
* {@inheritdoc}
public function getFilters()
return array(
'printArray' => new \Twig_SimpleFilter('printArray', array($this, 'printArray'), array('is_safe' => array('html'))),
);
}
* @param array $var
*
* @return mixed
public static function printArray(array $var)
return var_dump($var);
var_dump($var)
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.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
* Returns the name of the extension.
* @return string The extension name
public function getName()
return 'azine_mailgun_webhooks_bundle_twig_extension';
This check looks for function or method calls that always return null and whose return value is used.
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.