phpstan level 3, fixed deprecations, code cleanup (#811)

This commit is contained in:
Kevin Papst
2019-05-28 12:24:21 +02:00
committed by GitHub
parent d9dca96a32
commit 393abe9e62
69 changed files with 381 additions and 189 deletions

View File

@@ -31,11 +31,18 @@ use Symfony\Component\Routing\Annotation\Route;
class ProjectController extends AbstractController
{
/**
* @return \App\Repository\ProjectRepository
* @var ProjectRepository
*/
protected function getRepository()
private $repository;
public function __construct(ProjectRepository $repository)
{
return $this->getDoctrine()->getRepository(Project::class);
$this->repository = $repository;
}
protected function getRepository(): ProjectRepository
{
return $this->repository;
}
/**
@@ -64,7 +71,7 @@ class ProjectController extends AbstractController
}
/* @var $entries Pagerfanta */
$entries = $this->getDoctrine()->getRepository(Project::class)->findByQuery($query);
$entries = $this->getRepository()->findByQuery($query);
return $this->render('project/index.html.twig', [
'entries' => $entries,