Skip to content

Add return type declarations to future-proof vs Symfony\Component\Form\FormTypeInterface::getParent() #8

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 8 additions & 7 deletions Form/Type/GoogleMapType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ class GoogleMapType extends AbstractType

private $api_key;

public function __construct($api_key){
public function __construct($api_key): void
{
$this->api_key = $api_key;
}

/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// Default fields: latitude, longitude
$builder
Expand All @@ -50,7 +51,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'api_key' => $this->api_key,
Expand Down Expand Up @@ -79,7 +80,7 @@ public function configureOptions(OptionsResolver $resolver)
/**
* {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form, array $options)
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['api_key'] = $options['api_key'];
$view->vars['search_enabled'] = $options['search_enabled'];
Expand All @@ -95,17 +96,17 @@ public function buildView(FormView $view, FormInterface $form, array $options)
$view->vars['include_gmaps_js'] = $options['include_gmaps_js'];
}

public function getParent()
public function getParent(): ?string
{
return FormType::class;
}

public function getName()
public function getName(): string
{
return 'oh_google_maps';
}

public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'oh_google_maps';
}
Expand Down