Skip to content

Commit

Permalink
always use AbstractController
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Apr 23, 2022
1 parent 5f178a3 commit 2cf4e19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Resources/skeleton/controller/Controller.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace <?= $namespace; ?>;

use Symfony\Bundle\FrameworkBundle\Controller\<?= $parent_class_name; ?>;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class <?= $class_name; ?> extends <?= $parent_class_name; ?><?= "\n" ?>
class <?= $class_name; ?> extends AbstractController
{
<?= $generator->generateRouteForControllerMethod($route_path, $route_name); ?>
public function index(): Response
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/skeleton/crud/controller/Controller.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<?php else: ?>
use Doctrine\ORM\EntityManagerInterface;
<?php endif; ?>
use Symfony\Bundle\FrameworkBundle\Controller\<?= $parent_class_name ?>;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -21,7 +21,7 @@
* @Route("<?= $route_path ?>")
*/
<?php } ?>
class <?= $class_name ?> extends <?= $parent_class_name; ?><?= "\n" ?>
class <?= $class_name ?> extends AbstractController
{
<?= $generator->generateRouteForControllerMethod('/', sprintf('%s_index', $route_name), ['GET']) ?>
<?php if (isset($repository_full_class_name)): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<?= $use_statements; ?>

class <?= $class_name; ?> extends <?= $parent_class_name; ?><?= "\n" ?>
class <?= $class_name; ?> extends AbstractController
{
<?php if ($will_verify_email): ?>
private <?= $generator->getPropertyType($email_verifier_class_details) ?>$emailVerifier;
Expand Down

0 comments on commit 2cf4e19

Please sign in to comment.