Problem/Motivation
See #3455549: Add return typehints to protected test helper methods
Looks like some bool returns were missed in #3456611: Add bool return typehints to protected test helper methods.
The steps to reproduce below should help to find more.
Steps to reproduce
Add this to phpcs.xml.dist
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<include-pattern>*/tests/*</include-pattern>
</rule>
Run composer phpcbf
Grep the git diff output for changes that add : bool to protected or private methods:
git diff 11.x | grep -E "\+ (protected|private) function .*)\: bool"
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3470203
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3470203-protected-bool
changes, plain diff MR !9324
Comments
Comment #3
mstrelan commentedComment #4
smustgrave commentedSeems straight forward.
I can't wait till typehints are required.
Comment #5
quietone commentedUnfortunately, a few more instances have crept into the code. It seems we will be chasing our tail for a while on these. Let's get an update on this and then ping me when it is ready.
Comment #6
mstrelan commentedAdded a few more:
I intentionally left out the following:
Comment #7
quietone commentedAdding where work on AssertContentTrait is being done.
Comment #8
smustgrave commentedShould follow ups be made for those?
Comment #9
mstrelan commentedI've updated the parent / meta to mention union types in the remaining tasks. I think that also covers AssertContentTrait::getSelectedItem as I think it should return
string|false.Comment #10
smustgrave commentedSounds like a plan
Comment #12
quietone commentedCommitted acd24cb and pushed to 11.x.
Thanks!