Discussion
Loading...

#Tag

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
jpoesen | 🇪🇺 | 🏳️‍🌈
@jpoesen@drupal.community  ·  activity timestamp last week

Happy Sunday, #Drupal and #PHPStan friends.

Question: when trying to get past PHPStan rule level 5, I get complaints about arrays when used as param or return type.

➡️ https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Is there a Drupally consensus for typehinting these?

e.g this makes PHPStan happy but what do I know?

/**
* Implements hook_form_alter().
*
* @param $form string[]
*/
mymodule_form_alter(&$form, FormStateInterface $form_state, $form_id) { ... }

  • Copy link
  • Flag this post
  • Block
Helmut Hummel 🐝
@helhum@chaos.social  ·  activity timestamp 5 months ago
https://phpstan.org/r/6b9bdd7e-8fc3-4200-9dfa-ed7b29f6e41e

Any idea what #phpstan is complaining about here? #php

I don't get it.

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login