PSR 2 compliance

This commit is contained in:
Simon Vieille 2021-03-30 20:40:36 +02:00
parent 2352b8816a
commit 5ff1acb093
8 changed files with 16 additions and 19 deletions

View file

@ -2,12 +2,11 @@
namespace App\Controller\Blog\Api;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\JsonResponse;
use App\Markdown\Parser\Comment as CommentParser;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class CommentController extends AbstractController
{

View file

@ -5,9 +5,8 @@ namespace App\Controller\Blog;
use App\Core\Controller\Admin\AdminController;
use App\Core\Manager\EntityManager;
use App\Entity\Blog\Comment as Entity;
use App\Factory\Blog\CommentFactory as EntityFactory;
use App\Form\Blog\Filter\CommentFilterType;
use App\Form\Blog\CommentType as EntityType;
use App\Form\Blog\Filter\CommentFilterType;
use App\Repository\Blog\CommentRepositoryQuery as RepositoryQuery;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

View file

@ -18,7 +18,8 @@ class CommentFactory
$entity
->setPost($post)
->setIsActive(true);
->setIsActive(true)
;
return $entity;
}

View file

@ -3,7 +3,12 @@
namespace App\Form\Blog;
use App\Entity\Blog\Comment;
use App\Entity\Blog\Post;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
@ -12,12 +17,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Url;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Doctrine\ORM\EntityRepository;
use App\Entity\Blog\Post;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
class CommentType extends AbstractType
{

View file

@ -2,14 +2,13 @@
namespace App\Form\Blog\Filter;
use App\Entity\Blog\Post;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use App\Entity\Blog\Post;
use Symfony\Component\Form\ChoiceList\ChoiceList;
class CommentFilterType extends AbstractType
{

View file

@ -10,7 +10,6 @@ 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\Form\ChoiceList\ChoiceList;
class PostFilterType extends AbstractType
{

View file

@ -4,6 +4,8 @@ namespace App\Form\Blog;
use App\Entity\Blog\Comment;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
@ -12,8 +14,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Url;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
class UserCommentType extends AbstractType
{

View file

@ -34,7 +34,8 @@ class CommentRepositoryQuery extends RepositoryQuery
if ('post' === $name) {
$this
->andWhere('.post = :postId')
->setParameter(':postId', $value->getId());
->setParameter(':postId', $value->getId())
;
}
}
}