for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kunstmaan\AdminBundle\Toolbar;
use Doctrine\ORM\EntityManagerInterface;
use Kunstmaan\AdminBundle\Entity\Exception;
use Kunstmaan\AdminBundle\Helper\Toolbar\AbstractDataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class ExceptionDataCollector extends AbstractDataCollector
{
/**
* @var EntityManagerInterface
*/
private $em;
public function __construct(EntityManagerInterface $em)
$this->em = $em;
}
* @return array
string[]
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 getAccessRoles()
return ['ROLE_ADMIN'];
public function collectData()
$model = $this->em->getRepository(Exception::class)->findExceptionStatistics();
if (isset($model['cp_all'], $model['cp_sum'])) {
return [
'data' => $model,
];
} else {
return [];
* @param Request $request
* @param Response $response
* @param \Exception|null $exception
public function collect(Request $request, Response $response, \Exception $exception = null)
if (false === $this->isEnabled()) {
$this->data = false;
false
$data
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->data = $this->collectData();
* Gets the data for template
*
* @return array The request events
public function getTemplateData()
return $this->data;
* @return string
public function getName()
return 'kuma_exception';
* @return bool
public function isEnabled()
return true;
public function reset()
$this->data = [];
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.