Optimized namespaces

This commit is contained in:
Kevin Frantz 2018-10-03 17:10:15 +02:00
parent 011ef696f5
commit ab15856aa4
5 changed files with 7 additions and 6 deletions

View File

@ -12,6 +12,7 @@ use App\Entity\Source\SourceInterface;
use App\Creator\Factory\Template\Source\SourceTemplateFormFactory;
use App\Creator\Factory\Form\Source\SourceFormFactory;
use Symfony\Component\HttpFoundation\RedirectResponse;
use App\Entity\Source\AbstractSource;
/**
* @todo IMPLEMENT SECURITY!
@ -26,8 +27,8 @@ class SourceController extends FOSRestController
public function show(Request $request, int $id): Response
{
$source = $this->loadSource($request, $id);
$assembler = $this->get(SourceDTOAssember::class);
$dto = $assembler->build($source, $this->getUser());
#$assembler = $this->get(SourceDTOAssember::class);
#$dto = $assembler->build($source, $this->getUser());
$view = $this->view($source, 200)
->setTemplate((new SourceTemplateFactory($source, $request))->getTemplatePath())
->setTemplateVar('source');

View File

@ -7,7 +7,7 @@ use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz
*/
class AbstractSourceFactory
abstract class AbstractSourceFactory
{
/**
* @var SourceInterface

View File

@ -4,7 +4,7 @@ namespace App\Creator\Factory\Template\Source;
use App\Entity\Source\SourceInterface;
use Symfony\Component\HttpFoundation\Request;
use Creator\Factory\AbstractSourceFactory;
use App\Creator\Factory\AbstractSourceFactory;
/**
* @author kevinfrantz

View File

@ -26,7 +26,7 @@ class UserSource extends AbstractSource implements UserSourceInterface
protected $user;
/**
* @Assert\Type(type="App\Entity\NameSource")
* @Assert\Type(type="App\Entity\Source\NameSource")
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="NameSource",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="name_id", referencedColumnName="id")

View File

@ -6,7 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use App\Entity\NameSource;
use App\Entity\Source\NameSource;
class NameSourceType extends AbstractType
{