for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AppBundle\Menu;
use AppBundle\Security\AuthenticatedUserAwareInterface;
use AppBundle\Security\AuthenticatedUserAwareTrait;
use Knp\Menu\FactoryInterface;
class MenuBuilder implements AuthenticatedUserAwareInterface
{
use AuthenticatedUserAwareTrait;
/** @var FactoryInterface */
private $factory;
public function __construct(FactoryInterface $factory)
$this->factory = $factory;
}
public function createMainMenu(array $options)
$options
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$menu = $this->factory->createItem('root');
$menu->addChild('Home', ['route' => 'homepage'])
->setExtra('icon', 'home fa-lg');
$menu->addChild('Bookmarks', ['route' => 'bookmark.index'])
->setExtra('icon', 'bookmark');
$mailItem = $menu->addChild('Mail', ['route' => 'mail.index'])
->setExtra('icon', 'envelope');
$menu->addChild('K', ['uri' => '#'])
->setExtra('icon', 'newspaper-o');
if (($mailCount = $this->authenticatedUser->getMailCount())) {
$mailItem->setExtra('label', [
'content' => $mailCount,
]);
return $menu;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.