mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Applied CS fixer
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use App\Entity\Method;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use App\Creator\Factory\Template\Source\SourceTemplateFactory;
|
||||
use FOS\RestBundle\Controller\FOSRestController;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Creator\Factory\Template\Source\SourceTemplateFormFactory;
|
||||
use App\Creator\Factory\Form\Source\SourceFormFactory;
|
||||
@@ -15,16 +14,13 @@ use App\Entity\Source\AbstractSource;
|
||||
use App\Entity\Meta\RelationInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo IMPLEMENT SECURITY!
|
||||
*
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class SourceController extends AbstractEntityController
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @Route("/source/{id}.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function show(Request $request, int $id): Response
|
||||
@@ -35,12 +31,11 @@ class SourceController extends AbstractEntityController
|
||||
$view = $this->view($source, 200)
|
||||
->setTemplate((new SourceTemplateFactory($source, $request))->getTemplatePath())
|
||||
->setTemplateVar('source');
|
||||
|
||||
|
||||
return $this->handleView($view);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @Route("/source/{id}/edit.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function edit(Request $request, int $id): Response
|
||||
@@ -52,23 +47,24 @@ class SourceController extends AbstractEntityController
|
||||
$source = $form->getData();
|
||||
$this->saveSource($source);
|
||||
}
|
||||
|
||||
|
||||
return $this->render((new SourceTemplateFormFactory($source, $request))->getTemplatePath(), [
|
||||
'form' => $form->createView()
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @Route("/source/{id}/node.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function node(int $id): RedirectResponse
|
||||
{
|
||||
$nodeId = $this->loadNodeById($id)->getId();
|
||||
return $this->redirectToRouteById('app_node_show',$nodeId);
|
||||
|
||||
return $this->redirectToRouteById('app_node_show', $nodeId);
|
||||
}
|
||||
|
||||
private function loadNodeById(int $id):RelationInterface{
|
||||
|
||||
private function loadNodeById(int $id): RelationInterface
|
||||
{
|
||||
return $this->loadEntityById($id)->getNode();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user