Applied CS fixer

This commit is contained in:
Kevin Frantz
2018-10-29 19:01:00 +01:00
parent 91c41105c7
commit 6bc95f9729
46 changed files with 270 additions and 281 deletions

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Controller;
use App\Entity\EntityInterface;
@@ -6,9 +7,7 @@ use FOS\RestBundle\Controller\FOSRestController;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
*
* @author kevinfrantz
*
*/
abstract class AbstractEntityController extends FOSRestController
{
@@ -16,13 +15,14 @@ abstract class AbstractEntityController extends FOSRestController
* @var string
*/
protected $entityName;
public function __construct(){
public function __construct()
{
$this->setEntityName();
}
abstract protected function setEntityName():void;
abstract protected function setEntityName(): void;
protected function loadEntityById(int $id): EntityInterface
{
$entity = $this->getDoctrine()
@@ -31,13 +31,14 @@ abstract class AbstractEntityController extends FOSRestController
if (!$entity) {
throw $this->createNotFoundException('No entity found for id '.$id);
}
return $entity;
}
protected function redirectToRouteById(string $route, int $id): RedirectResponse
{
return $this->redirectToRoute($route, [
'id' => $id
'id' => $id,
]);
}
}
}