Skip to content

Commit

Permalink
refactor: Removed deprecated AppController.php and Handler methods. R…
Browse files Browse the repository at this point in the history
…emoved FrontendController.php.
  • Loading branch information
roadiz-ci committed Mar 14, 2024
1 parent 8720861 commit d410cf8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/dev.php
/install.php
/clear_cache.php
/pimple.json
/assets
project_env.sh

Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"guzzlehttp/guzzle": "^7.2.0",
"jms/serializer": "^3.9.0",
"league/flysystem": "^3.0",
"pimple/pimple": "^3.3.1",
"ramsey/uuid": "^4.7",
"roadiz/compat-bundle": "2.3.x-dev",
"roadiz/core-bundle": "2.3.x-dev",
Expand Down
9 changes: 6 additions & 3 deletions src/Controllers/Nodes/NodesAttributesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use RZ\Roadiz\CoreBundle\Event\NodesSources\NodesSourcesUpdatedEvent;
use RZ\Roadiz\CoreBundle\Form\AttributeValueTranslationType;
use RZ\Roadiz\CoreBundle\Form\AttributeValueType;
use RZ\Roadiz\CoreBundle\Form\Error\FormErrorSerializer;
use RZ\Roadiz\CoreBundle\Security\Authorization\Voter\NodeVoter;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormFactoryInterface;
Expand All @@ -26,8 +27,10 @@

class NodesAttributesController extends RozierApp
{
public function __construct(private readonly FormFactoryInterface $formFactory)
{
public function __construct(
private readonly FormFactoryInterface $formFactory,
private readonly FormErrorSerializer $formErrorSerializer
) {
}

/**
Expand Down Expand Up @@ -126,7 +129,7 @@ public function editAction(Request $request, int $nodeId, int $translationId): R
'translationId' => $translation->getId(),
]);
} else {
$errors = $this->getErrorsAsArray($attributeValueTranslationForm);
$errors = $this->formErrorSerializer->getErrorsAsArray($attributeValueTranslationForm);
/*
* Handle errors when Ajax POST requests
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Controllers/Tags/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use RZ\Roadiz\CoreBundle\Event\Tag\TagDeletedEvent;
use RZ\Roadiz\CoreBundle\Event\Tag\TagUpdatedEvent;
use RZ\Roadiz\CoreBundle\Exception\EntityAlreadyExistsException;
use RZ\Roadiz\CoreBundle\Form\Error\FormErrorSerializer;
use RZ\Roadiz\CoreBundle\Repository\TranslationRepository;
use RZ\Roadiz\Utils\StringHandler;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
Expand All @@ -41,6 +42,7 @@ class TagsController extends RozierApp

public function __construct(
private readonly FormFactoryInterface $formFactory,
private readonly FormErrorSerializer $formErrorSerializer,
private readonly HandlerFactoryInterface $handlerFactory,
private readonly TreeWidgetFactory $treeWidgetFactory
) {
Expand Down Expand Up @@ -202,7 +204,7 @@ public function editTranslatedAction(Request $request, int $tagId, ?int $transla
* Handle errors when Ajax POST requests
*/
if ($isJsonRequest) {
$errors = $this->getErrorsAsArray($form);
$errors = $this->formErrorSerializer->getErrorsAsArray($form);
return new JsonResponse([
'status' => 'fail',
'errors' => $errors,
Expand Down Expand Up @@ -397,7 +399,7 @@ public function editSettingsAction(Request $request, int $tagId): Response
* Handle errors when Ajax POST requests
*/
if ($isJsonRequest) {
$errors = $this->getErrorsAsArray($form);
$errors = $this->formErrorSerializer->getErrorsAsArray($form);
return new JsonResponse([
'status' => 'fail',
'errors' => $errors,
Expand Down
5 changes: 1 addition & 4 deletions src/RozierApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ protected function getNamespacedView(string $view, string $namespace = ''): stri
return $view;
}

/**
* @return $this
*/
public function prepareBaseAssignation()
public function prepareBaseAssignation(): static
{
parent::prepareBaseAssignation();
/*
Expand Down

0 comments on commit d410cf8

Please sign in to comment.