for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kunstmaan\AdminBundle\Twig;
use Kunstmaan\NodeBundle\Entity\HideSidebarInNodeEditInterface;
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
/**
* @final since 5.4
*/
class SidebarTwigExtension extends AbstractExtension
{
* Get Twig functions defined in this extension.
*
* @return array
TwigFunction[]
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function getFunctions()
return array(
new TwigFunction('hideSidebarInNodeEditAdmin', array($this, 'hideSidebarInNodeEditAdmin')),
);
}
* Return the admin menu MenuBuilder.
* @return MenuBuilder
boolean
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
public function hideSidebarInNodeEditAdmin($node)
return $node instanceof HideSidebarInNodeEditInterface;
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.