for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kunstmaan\AdminListBundle\AdminList\ItemAction;
/**
* The simple item action is a default implementation of the item action interface, this can be used
* in very simple use cases.
*/
class SimpleItemAction implements ItemActionInterface
{
* @var callable
private $routerGenerator;
* @var string
private $icon;
private $label;
* @var string|null
private $template;
* @param callable $routerGenerator the generator used to generate the url of an item, when generating the item will
* be provided
* @param string $icon The icon
* @param string $label The label
* @param string $template The template
$template
string|null
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.
public function __construct($routerGenerator, $icon, $label, $template = null)
$this->routerGenerator = $routerGenerator;
$this->icon = $icon;
$this->label = $label;
$this->template = $template;
}
* @param mixed $item
*
* @return string
public function getUrlFor($item)
$routeGenerator = $this->routerGenerator;
if (\is_callable($routeGenerator)) {
return $routeGenerator($item);
return null;
public function getIconFor($item)
return $this->icon;
public function getLabelFor($item)
return $this->label;
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 getTemplate()
return $this->template;
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.