mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 01:53:49 +00:00
fix: SA: Fix "...invoked with..." rule.
SA stands for Static Analysis.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\DocStoreBundle\Controller;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\DocumentCategory;
|
||||
@@ -9,11 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Chill\DocStoreBundle\ChillDocStoreBundle;
|
||||
|
||||
/**
|
||||
* Class DocumentCategoryController
|
||||
*
|
||||
* @package Chill\DocStoreBundle\Controller
|
||||
* @Route("/{_locale}/admin/document/category")
|
||||
*/
|
||||
class DocumentCategoryController extends AbstractController
|
||||
@@ -24,11 +24,14 @@ class DocumentCategoryController extends AbstractController
|
||||
public function index(): Response
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$categories = $em->getRepository("ChillDocStoreBundle:DocumentCategory")->findAll();
|
||||
$categories = $em->getRepository(DocumentCategory::class)->findAll();
|
||||
|
||||
return $this->render(
|
||||
'ChillDocStoreBundle:DocumentCategory:index.html.twig',
|
||||
['document_categories' => $categories]);
|
||||
[
|
||||
'document_categories' => $categories,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,13 +40,10 @@ class DocumentCategoryController extends AbstractController
|
||||
public function new(Request $request): Response
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$documentCategory = new DocumentCategory();
|
||||
$documentCategory
|
||||
->setBundleId('Chill\DocStoreBundle\ChillDocStoreBundle');
|
||||
$documentCategory
|
||||
->setIdInsideBundle(
|
||||
$em->getRepository("ChillDocStoreBundle:DocumentCategory")
|
||||
->nextIdInsideBundle());
|
||||
$documentCategory = new DocumentCategory(
|
||||
ChillDocStoreBundle::class,
|
||||
$em->getRepository(DocumentCategory::class)->nextIdInsideBundle()
|
||||
);
|
||||
$documentCategory
|
||||
->setDocumentClass(PersonDocument::class);
|
||||
|
||||
@@ -56,11 +56,10 @@ class DocumentCategoryController extends AbstractController
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('document_category_index');
|
||||
} else {
|
||||
$documentCategory->setBundleId(
|
||||
'Chill\DocStoreBundle\ChillDocStoreBundle');
|
||||
}
|
||||
|
||||
$documentCategory->setBundleId(ChillDocStoreBundle::class);
|
||||
|
||||
return $this->render('ChillDocStoreBundle:DocumentCategory:new.html.twig', [
|
||||
'document_category' => $documentCategory,
|
||||
'form' => $form->createView(),
|
||||
|
Reference in New Issue
Block a user