for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of AppName.
*
* (c) Monofony
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Menu;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
final class AdminMenuBuilder
{
/** @var FactoryInterface */
private $factory;
public function __construct(FactoryInterface $factory)
$this->factory = $factory;
}
public function createMenu(array $options): ItemInterface
$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');
$this->addCustomerSubMenu($menu);
$this->addConfigurationSubMenu($menu);
return $menu;
private function addCustomerSubMenu(ItemInterface $menu): ItemInterface
$customer = $menu
->addChild('customer')
->setLabel('sylius.ui.customer')
;
$customer->addChild('backend_customer', ['route' => 'sylius_backend_customer_index'])
->setLabel('sylius.ui.customers')
->setLabelAttribute('icon', 'users');
return $customer;
private function addConfigurationSubMenu(ItemInterface $menu): ItemInterface
$configuration = $menu
->addChild('configuration')
->setLabel('sylius.ui.configuration')
$configuration->addChild('backend_admin_user', ['route' => 'sylius_backend_admin_user_index'])
->setLabel('sylius.ui.admin_users')
->setLabelAttribute('icon', 'lock');
return $configuration;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.