Skip to content

Commit 5a33ed3

Browse files
committed
feature #925 [templates] Add void return types (seb-jean, jrushlow)
This PR was merged into the 1.0-dev branch. Discussion ---------- [templates] Add void return types Commits ------- f957ceb add test expectation 339de6b Update SecurityController_logout.php 71a0570 Update SecurityControllerBuilder.php 841b6ed Update Fixtures.tpl.php 168befd Update Type.tpl.php
2 parents 203699d + f957ceb commit 5a33ed3

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Resources/skeleton/doctrine/Fixtures.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class <?= $class_name ?> extends Fixture
99
{
10-
public function load(ObjectManager $manager)
10+
public function load(ObjectManager $manager): void
1111
{
1212
// $product = new Product();
1313
// $manager->persist($product);

src/Resources/skeleton/form/Type.tpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class <?= $class_name ?> extends AbstractType
1919
{
20-
public function buildForm(FormBuilderInterface $builder, array $options)
20+
public function buildForm(FormBuilderInterface $builder, array $options): void
2121
{
2222
$builder
2323
<?php foreach ($form_fields as $form_field => $typeOptions): ?>
@@ -34,7 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3434
;
3535
}
3636

37-
public function configureOptions(OptionsResolver $resolver)
37+
public function configureOptions(OptionsResolver $resolver): void
3838
{
3939
$resolver->setDefaults([
4040
<?php if ($bounded_full_class_name): ?>

src/Security/SecurityControllerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function addLoginMethod(ClassSourceManipulator $manipulator): void
6666

6767
public function addLogoutMethod(ClassSourceManipulator $manipulator): void
6868
{
69-
$logoutMethodBuilder = $manipulator->createMethodBuilder('logout', null, false, ['@Route("/logout", name="app_logout")']);
69+
$logoutMethodBuilder = $manipulator->createMethodBuilder('logout', 'void', false, ['@Route("/logout", name="app_logout")']);
7070

7171
$manipulator->addUseStatementIfNecessary(Route::class);
7272
$manipulator->addMethodBody($logoutMethodBuilder, <<<'CODE'

tests/Security/fixtures/expected/SecurityController_login_logout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function login(AuthenticationUtils $authenticationUtils): Response
2929
/**
3030
* @Route("/logout", name="app_logout")
3131
*/
32-
public function logout()
32+
public function logout(): void
3333
{
3434
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
3535
}

tests/Security/fixtures/expected/SecurityController_logout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SecurityController extends AbstractController
1010
/**
1111
* @Route("/logout", name="app_logout")
1212
*/
13-
public function logout()
13+
public function logout(): void
1414
{
1515
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
1616
}

0 commit comments

Comments
 (0)