소스 검색

Essai injection de dépendances

develop
Guillaume 3 년 전
부모
커밋
475c01fc6d
17개의 변경된 파일106개의 추가작업 그리고 18개의 파일을 삭제
  1. +12
    -0
      Controller/AbstractAdminController.php
  2. +1
    -1
      Controller/Setting/SettingAdminController.php
  3. +2
    -2
      Controller/Ticket/TicketAdminController.php
  4. +16
    -0
      Factory/Site/PageFactory.php
  5. +2
    -2
      Factory/Ticket/TicketFactory.php
  6. +1
    -1
      Factory/Ticket/TicketMessageFactory.php
  7. +8
    -0
      Factory/Ticket/TicketMessageFactoryInterface.php
  8. +1
    -1
      Repository/Reminder/ReminderRepositoryQuery.php
  9. +8
    -0
      Repository/Reminder/ReminderRepositoryQueryInterface.php
  10. +3
    -3
      Repository/Reminder/ReminderStore.php
  11. +8
    -0
      Repository/Reminder/ReminderStoreInterface.php
  12. +14
    -0
      Repository/Ticket/TicketRepositoryQuery.php
  13. +8
    -0
      Repository/Ticket/TicketRepositoryQueryInterface.php
  14. +14
    -0
      Repository/Ticket/TicketStore.php
  15. +8
    -0
      Repository/Ticket/TicketStoreInterface.php
  16. +0
    -7
      Twig/TranslatorTwigExtension.php
  17. +0
    -1
      Twig/TwigExtension.php

+ 12
- 0
Controller/AbstractAdminController.php 파일 보기

@@ -332,6 +332,18 @@ abstract class AbstractAdminController extends EaAbstractCrudController
);
}

public function createEntity(string $entityFqcn)
{
if(method_exists($this, 'getEntityFactory')) {
$factoryClass = $this->getEntityFactory();
$factory = new $factoryClass;
return $factory->create();
}
else {
return parent::createEntity($entityFqcn);
}
}

public function updateEntity(EntityManagerInterface $entityManager, $entityInstance): void
{
$entityManager->update($entityInstance);

+ 1
- 1
Controller/Setting/SettingAdminController.php 파일 보기

@@ -35,7 +35,7 @@ class SettingAdminController extends AbstractController
}

/**
* @Route("/admin/setting/site", name="sov_admin_setting_global")
* @Route("/admin/setting/site", name="sov_admin_setting_site")
*/
public function manageGlobal(Request $request)
{

+ 2
- 2
Controller/Ticket/TicketAdminController.php 파일 보기

@@ -14,7 +14,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator;
use Lc\SovBundle\Factory\Ticket\TicketFactoryInterface;
use Lc\SovBundle\Factory\Ticket\TicketMessageFactory;
use Lc\SovBundle\Factory\Ticket\TicketMessageFactoryInterface;
use Lc\SovBundle\Form\Ticket\TicketFormType;
use Lc\SovBundle\Form\Ticket\TicketMessageFormType;
use Lc\SovBundle\Form\Ticket\TicketStatusType;
@@ -33,7 +33,7 @@ class TicketAdminController extends AbstractAdminController

public function __construct(
TicketFactoryInterface $ticketFactory,
TicketMessageFactory $ticketMessageFactory,
TicketMessageFactoryInterface $ticketMessageFactory,
AdminUrlGenerator $adminUrlGenerator
) {
$this->ticketFactory = $ticketFactory;

+ 16
- 0
Factory/Site/PageFactory.php 파일 보기

@@ -0,0 +1,16 @@
<?php

namespace Lc\SovBundle\Factory\Site;

use App\Entity\Site\Page;
use Lc\SovBundle\Factory\AbstractFactory;

class PageFactory extends AbstractFactory
{
public function create()
{
$page = new Page();

return $page;
}
}

+ 2
- 2
Factory/Ticket/TicketFactory.php 파일 보기

@@ -7,9 +7,9 @@ use Lc\SovBundle\Factory\AbstractFactory;

class TicketFactory extends AbstractFactory implements TicketFactoryInterface
{
protected TicketMessageFactory $ticketMessageFactory;
protected TicketMessageFactoryInterface $ticketMessageFactory;

public function __construct(TicketMessageFactory $ticketMessageFactory)
public function __construct(TicketMessageFactoryInterface $ticketMessageFactory)
{
$this->ticketMessageFactory = $ticketMessageFactory;
}

+ 1
- 1
Factory/Ticket/TicketMessageFactory.php 파일 보기

@@ -5,7 +5,7 @@ namespace Lc\SovBundle\Factory\Ticket;
use App\Entity\Ticket\TicketMessage;
use Lc\SovBundle\Factory\AbstractFactory;

class TicketMessageFactory extends AbstractFactory
class TicketMessageFactory extends AbstractFactory implements TicketMessageFactoryInterface
{
public function create()
{

+ 8
- 0
Factory/Ticket/TicketMessageFactoryInterface.php 파일 보기

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Factory\Ticket;

interface TicketMessageFactoryInterface
{

}

+ 1
- 1
Repository/Reminder/ReminderRepositoryQuery.php 파일 보기

@@ -5,7 +5,7 @@ namespace Lc\SovBundle\Repository\Reminder;
use Knp\Component\Pager\PaginatorInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class ReminderRepositoryQuery extends AbstractRepositoryQuery
class ReminderRepositoryQuery extends AbstractRepositoryQuery implements ReminderRepositoryQueryInterface
{
public function __construct(ReminderRepositoryInterface $repository, PaginatorInterface $paginator)
{

+ 8
- 0
Repository/Reminder/ReminderRepositoryQueryInterface.php 파일 보기

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Reminder;

interface ReminderRepositoryQueryInterface
{

}

+ 3
- 3
Repository/Reminder/ReminderStore.php 파일 보기

@@ -2,11 +2,11 @@

namespace Lc\SovBundle\Repository\Reminder;

class ReminderStore
class ReminderStore implements ReminderStoreInterface
{
protected ReminderRepositoryQuery $query;
protected ReminderRepositoryQueryInterface $query;

public function __construct(ReminderRepositoryQuery $query)
public function __construct(ReminderRepositoryQueryInterface $query)
{
$this->query = $query;
}

+ 8
- 0
Repository/Reminder/ReminderStoreInterface.php 파일 보기

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Reminder;

interface ReminderStoreInterface
{

}

+ 14
- 0
Repository/Ticket/TicketRepositoryQuery.php 파일 보기

@@ -0,0 +1,14 @@
<?php

namespace Lc\SovBundle\Repository\Ticket;

use Knp\Component\Pager\PaginatorInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRepositoryQueryInterface
{
public function __construct(TicketRepositoryInterface $repository, PaginatorInterface $paginator)
{
parent::__construct($repository, 'r', $paginator);
}
}

+ 8
- 0
Repository/Ticket/TicketRepositoryQueryInterface.php 파일 보기

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Ticket;

interface TicketRepositoryQueryInterface
{

}

+ 14
- 0
Repository/Ticket/TicketStore.php 파일 보기

@@ -0,0 +1,14 @@
<?php

namespace Lc\SovBundle\Repository\Ticket;

class TicketStore implements TicketStoreInterface
{
protected TicketRepositoryQueryInterface $query;

public function __construct(TicketRepositoryQueryInterface $query)
{
$this->query = $query;
}

}

+ 8
- 0
Repository/Ticket/TicketStoreInterface.php 파일 보기

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Ticket;

interface TicketStoreInterface
{

}

+ 0
- 7
Twig/TranslatorTwigExtension.php 파일 보기

@@ -2,18 +2,11 @@

namespace Lc\SovBundle\Twig;

use App\Repository\ReminderRepository;
use Doctrine\ORM\EntityManagerInterface;
use Lc\SovBundle\Model\Reminder\ReminderInterface;
use Lc\SovBundle\Repository\Reminder\ReminderStore;
use Lc\SovBundle\Translation\TranslatorAdmin;
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;

+ 0
- 1
Twig/TwigExtension.php 파일 보기

@@ -4,7 +4,6 @@ namespace Lc\SovBundle\Twig;

use App\Repository\ReminderRepository;
use Doctrine\ORM\EntityManagerInterface;
use Lc\SovBundle\Model\Reminder\ReminderInterface;
use Lc\SovBundle\Repository\Reminder\ReminderStore;
use Lc\SovBundle\Translation\TranslatorAdmin;
use Liip\ImagineBundle\Imagine\Cache\CacheManager;

Loading…
취소
저장