PSR 2 compliance
This commit is contained in:
parent
2352b8816a
commit
5ff1acb093
|
@ -2,12 +2,11 @@
|
||||||
|
|
||||||
namespace App\Controller\Blog\Api;
|
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 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\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
class CommentController extends AbstractController
|
class CommentController extends AbstractController
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,9 +5,8 @@ namespace App\Controller\Blog;
|
||||||
use App\Core\Controller\Admin\AdminController;
|
use App\Core\Controller\Admin\AdminController;
|
||||||
use App\Core\Manager\EntityManager;
|
use App\Core\Manager\EntityManager;
|
||||||
use App\Entity\Blog\Comment as Entity;
|
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\CommentType as EntityType;
|
||||||
|
use App\Form\Blog\Filter\CommentFilterType;
|
||||||
use App\Repository\Blog\CommentRepositoryQuery as RepositoryQuery;
|
use App\Repository\Blog\CommentRepositoryQuery as RepositoryQuery;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
|
@ -18,7 +18,8 @@ class CommentFactory
|
||||||
|
|
||||||
$entity
|
$entity
|
||||||
->setPost($post)
|
->setPost($post)
|
||||||
->setIsActive(true);
|
->setIsActive(true)
|
||||||
|
;
|
||||||
|
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,12 @@
|
||||||
namespace App\Form\Blog;
|
namespace App\Form\Blog;
|
||||||
|
|
||||||
use App\Entity\Blog\Comment;
|
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\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\TextareaType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
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\Email;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Url;
|
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
|
class CommentType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
|
|
||||||
namespace App\Form\Blog\Filter;
|
namespace App\Form\Blog\Filter;
|
||||||
|
|
||||||
|
use App\Entity\Blog\Post;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use App\Entity\Blog\Post;
|
|
||||||
use Symfony\Component\Form\ChoiceList\ChoiceList;
|
|
||||||
|
|
||||||
class CommentFilterType extends AbstractType
|
class CommentFilterType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,6 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Form\ChoiceList\ChoiceList;
|
|
||||||
|
|
||||||
class PostFilterType extends AbstractType
|
class PostFilterType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,8 @@ namespace App\Form\Blog;
|
||||||
|
|
||||||
use App\Entity\Blog\Comment;
|
use App\Entity\Blog\Comment;
|
||||||
use Symfony\Component\Form\AbstractType;
|
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\TextareaType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
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\Email;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Url;
|
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
|
class UserCommentType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,8 @@ class CommentRepositoryQuery extends RepositoryQuery
|
||||||
if ('post' === $name) {
|
if ('post' === $name) {
|
||||||
$this
|
$this
|
||||||
->andWhere('.post = :postId')
|
->andWhere('.post = :postId')
|
||||||
->setParameter(':postId', $value->getId());
|
->setParameter(':postId', $value->getId())
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue