PSR 2 compliance
This commit is contained in:
parent
eb93d1369a
commit
c8156eb709
|
@ -14,12 +14,12 @@ use App\Core\Form\Site\NodeType as EntityType;
|
|||
use App\Core\Manager\EntityManager;
|
||||
use App\Core\Repository\Site\NodeRepository;
|
||||
use App\Core\Site\PageLocator;
|
||||
use App\Core\Sitemap\SitemapBuilder;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use App\Core\Sitemap\SitemapBuilder;
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/node")
|
||||
|
@ -79,9 +79,8 @@ class NodeAdminController extends AdminController
|
|||
'navigation' => $node->getMenu()->getNavigation()->getId(),
|
||||
'data-modal' => $this->generateUrl('admin_site_node_edit', ['entity' => $entity->getId()]),
|
||||
]);
|
||||
} else {
|
||||
$this->addFlash('warning', 'Le formulaire est invalide.');
|
||||
}
|
||||
$this->addFlash('warning', 'Le formulaire est invalide.');
|
||||
|
||||
return $this->redirectToRoute('admin_site_tree_navigation', [
|
||||
'navigation' => $node->getMenu()->getNavigation()->getId(),
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
namespace App\Core\Controller\Site;
|
||||
|
||||
use App\Core\Site\SiteRequest;
|
||||
use App\Core\Site\SiteStore;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use App\Core\Site\SiteStore;
|
||||
|
||||
class PageController extends AbstractController
|
||||
{
|
||||
|
|
|
@ -381,7 +381,7 @@ class Node implements EntityInterface
|
|||
public function getSitemapParameters(): ?array
|
||||
{
|
||||
if (!is_array($this->sitemapParameters)) {
|
||||
$this->sitemapParameters= [
|
||||
$this->sitemapParameters = [
|
||||
'isVisible' => false,
|
||||
'priority' => 0,
|
||||
'changeFrequency' => 'daily',
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace App\Core\Entity\Site\Page;
|
||||
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
use App\Core\Repository\Site\Page\BlockRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
namespace App\Core\EventSuscriber\Site\Page;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Entity\Site\Page\Block;
|
||||
use App\Core\Entity\Site\Page\FileBlock;
|
||||
use App\Core\Entity\Site\Page\Page;
|
||||
use App\Core\Event\EntityManager\EntityManagerEvent;
|
||||
use App\Core\EventSuscriber\EntityManagerEventSubscriber;
|
||||
use App\Core\Form\FileUploadHandler;
|
||||
use App\Core\Entity\Site\Page\FileBlock;
|
||||
use App\Core\Entity\Site\Page\Page;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,19 +3,15 @@
|
|||
namespace App\Core\EventSuscriber\Site;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Entity\Site\Menu;
|
||||
use App\Core\Entity\Site\Navigation;
|
||||
use App\Core\Entity\Site\Node;
|
||||
use App\Core\Event\EntityManager\EntityManagerEvent;
|
||||
use App\Core\EventSuscriber\EntityManagerEventSubscriber;
|
||||
use App\Core\Factory\Site\NodeFactory;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Core\Repository\Site\NodeRepository;
|
||||
use App\Core\Slugify\Slugify;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Output\BufferedOutput;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use App\Core\Entity\Site\Menu;
|
||||
use App\Core\Entity\Site\Navigation;
|
||||
|
||||
/**
|
||||
* class SiteEventSubscriber.
|
||||
|
@ -26,7 +22,8 @@ class SiteEventSubscriber extends EntityManagerEventSubscriber
|
|||
{
|
||||
protected KernelInterface $kernel;
|
||||
|
||||
public function __construct(KernelInterface $kernel) {
|
||||
public function __construct(KernelInterface $kernel)
|
||||
{
|
||||
$this->kernel = $kernel;
|
||||
}
|
||||
|
||||
|
@ -35,19 +32,6 @@ class SiteEventSubscriber extends EntityManagerEventSubscriber
|
|||
return $entity instanceof Node || $entity instanceof Menu || $entity instanceof Navigation;
|
||||
}
|
||||
|
||||
protected function cleanCache()
|
||||
{
|
||||
$application = new Application($this->kernel);
|
||||
$application->setAutoExit(false);
|
||||
|
||||
$input = new ArrayInput([
|
||||
'command' => 'cache:clear',
|
||||
]);
|
||||
|
||||
$output = new BufferedOutput();
|
||||
$application->run($input, $output);
|
||||
}
|
||||
|
||||
public function onUpdate(EntityManagerEvent $event)
|
||||
{
|
||||
if (!$this->support($event->getEntity())) {
|
||||
|
@ -67,4 +51,16 @@ class SiteEventSubscriber extends EntityManagerEventSubscriber
|
|||
return $this->onUpdate($event);
|
||||
}
|
||||
|
||||
protected function cleanCache()
|
||||
{
|
||||
$application = new Application($this->kernel);
|
||||
$application->setAutoExit(false);
|
||||
|
||||
$input = new ArrayInput([
|
||||
'command' => 'cache:clear',
|
||||
]);
|
||||
|
||||
$output = new BufferedOutput();
|
||||
$application->run($input, $output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ class NodeFactory
|
|||
$entity->setUrl($url);
|
||||
}
|
||||
|
||||
|
||||
return $entity;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
namespace App\Core\Form\Site;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class NodeAttributeType extends AbstractType
|
||||
|
@ -38,7 +38,6 @@ class NodeAttributeType extends AbstractType
|
|||
],
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
namespace App\Core\Form\Site;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class NodeParameterType extends AbstractType
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace App\Core\Form\Site;
|
|||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
|
|
@ -8,11 +8,11 @@ use Doctrine\ORM\EntityRepository;
|
|||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||
|
||||
class NodeType extends AbstractType
|
||||
{
|
||||
|
|
|
@ -2,15 +2,10 @@
|
|||
|
||||
namespace App\Core\Form\Site\Page;
|
||||
|
||||
use App\Core\Entity\Site\Page\Block;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use App\Core\Entity\Site\Page\FileBlock;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use App\Core\Entity\Site\Page\FileBlock;
|
||||
|
||||
class FileBlockType extends TextBlockType
|
||||
{
|
||||
|
|
|
@ -2,15 +2,8 @@
|
|||
|
||||
namespace App\Core\Form\Site\Page;
|
||||
|
||||
use App\Core\Entity\Site\Page\Block;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use App\Core\Entity\Site\Page\FileBlock;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints\Image;
|
||||
|
||||
class ImageBlockType extends FileBlockType
|
||||
|
|
|
@ -5,12 +5,12 @@ namespace App\Core\Form\Site\Page;
|
|||
use App\Core\Entity\Site\Page\Page;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Validator\Constraints\Image;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class PageType extends AbstractType
|
||||
{
|
||||
|
|
|
@ -288,7 +288,7 @@ class MailNotifier
|
|||
{
|
||||
$message = $this->createMessage(
|
||||
$this->twig->render(
|
||||
sprintf('mail/%s.html.twig', $template),
|
||||
$template,
|
||||
$data
|
||||
),
|
||||
$type
|
||||
|
|
|
@ -21,6 +21,7 @@ class NavigationRepositoryQuery extends RepositoryQuery
|
|||
{
|
||||
return $this
|
||||
->andWhere('.domain = :domain')
|
||||
->setParameter(':domain', $domain);
|
||||
->setParameter(':domain', $domain)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class SiteRouteLoader extends Loader
|
|||
foreach ($navigations as $navigation) {
|
||||
foreach ($navigation->getMenus() as $menu) {
|
||||
foreach ($menu->getRootNode()->getAllChildren() as $node) {
|
||||
if ($node->getParent() === null) {
|
||||
if (null === $node->getParent()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ class SiteRouteLoader extends Loader
|
|||
|
||||
if (null !== $parameter['requirement']) {
|
||||
$requirements[$name] = $parameter['requirement'];
|
||||
};
|
||||
}
|
||||
|
||||
if (null !== $parameter['defaultValue']) {
|
||||
$defaults[$name] = $parameter['defaultValue'];
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Core\Site;
|
||||
|
||||
use App\Core\Entity\Site\Navigation;
|
||||
use App\Core\Repository\Site\NavigationRepositoryQuery;
|
||||
use App\Core\Entity\Site\Node;
|
||||
use App\Core\Repository\Site\NavigationRepositoryQuery;
|
||||
|
||||
/**
|
||||
* class SiteStore.
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace App\Core\Twig\Extension;
|
||||
|
||||
use App\Core\String\StringBuilder;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
use App\Core\String\StringBuilder;
|
||||
|
||||
class StringExtension extends AbstractExtension
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue