Skip to content

[templates] Add void return types #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Resources/skeleton/doctrine/Fixtures.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class <?= $class_name ?> extends Fixture
{
public function load(ObjectManager $manager)
public function load(ObjectManager $manager): void
{
// $product = new Product();
// $manager->persist($product);
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/skeleton/form/Type.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class <?= $class_name ?> extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
<?php foreach ($form_fields as $form_field => $typeOptions): ?>
Expand All @@ -34,7 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
;
}

public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
<?php if ($bounded_full_class_name): ?>
Expand Down
2 changes: 1 addition & 1 deletion src/Security/SecurityControllerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function addLoginMethod(ClassSourceManipulator $manipulator): void

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

$manipulator->addUseStatementIfNecessary(Route::class);
$manipulator->addMethodBody($logoutMethodBuilder, <<<'CODE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function login(AuthenticationUtils $authenticationUtils): Response
/**
* @Route("/logout", name="app_logout")
*/
public function logout()
public function logout(): void
{
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SecurityController extends AbstractController
/**
* @Route("/logout", name="app_logout")
*/
public function logout()
public function logout(): void
{
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
}
Expand Down