for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kunstmaan\MenuBundle\Service;
use Kunstmaan\AdminBundle\Helper\Menu\MenuAdaptorInterface;
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
use Kunstmaan\AdminBundle\Helper\Menu\MenuItem;
use Kunstmaan\AdminBundle\Helper\Menu\TopMenuItem;
use Symfony\Component\HttpFoundation\Request;
class MenuAdaptor implements MenuAdaptorInterface
{
/**
* @var array
*/
private $menuNames;
public function __construct(array $menuNames)
$this->menuNames = $menuNames;
}
* @param MenuItem $parent
$parent
null|MenuItem
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
* @param Request $request
$request
null|Request
public function adaptChildren(MenuBuilder $menu, array &$children, MenuItem $parent = null, Request $request = null)
if ((count($this->menuNames) > 0) && null !== $parent && 'KunstmaanAdminBundle_modules' === $parent->getRoute()) {
$menuItem = new TopMenuItem($menu);
$menuItem
->setRoute('kunstmaanmenubundle_admin_menu')
->setUniqueId('menus')
->setLabel('kuma_menu.menus.title')
->setParent($parent);
if ($request->attributes->get('_route') === 'kunstmaanmenubundle_admin_menu') {
$menuItem->setActive(true);
$parent->setActive(true);
$children[] = $menuItem;
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.