Problem/Motivation
From the PHP manual:
By default, PHP will coerce values of the wrong type into the expected scalar type declaration if possible. For example, a function that is given an int for a parameter that expects a string will get a variable of type string.
This silent type-casting is often unintentional and can result in bugs.
We set declare(strict_types=1); in 28 of the 35 PHP files in the test directory (at time-of-writing). We should do this in all tests. While it only affects how PHP juggles types in the test, we should start somewhere!
Proposed resolution
Add declare(strict_types=1); to all test PHP files.
Remaining tasks
Merge request for 9.0.x- merge request !205 created by @mparker17 in #3Merge request for 8.0.x- merge request !206 created by @mparker17 in #5Community review- skipped by @mparker17 in #7Maintainer review- skipped by @mparker17 in #7Commit 9.0.x- merged by @mparker17 in #9Commit 8.0.x- merged by @mparker17 in #11Release 9.0.x- released in 9.0.0-alpha3 by @mparker17Release 8.0.x- released in 8.0.0-alpha7 by @mparker17
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork elasticsearch_connector-3586367
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:
Comments
Comment #2
mparker17Comment #4
mparker17Added a MR for 9.0.x; lets see what testbot thinks before we create something for 8.0.x.
Comment #6
mparker179.0.x tests pass, creating an 8.0.x MR
Comment #7
mparker17Great, tests pass in both branches.
Given that the change is to test-only code, it should be a very-low-impact change, so I'm going to skip the community review. And given that I'm the maintainer, it doesn't need a maintainer review step.
Comment #8
mparker17Should have moved to RTBC in the last comment.
Comment #10
mparker17Great! Merging to 8.0.x
Comment #12
mparker17Merged to 8.0.x.
I will update this issue when the code is released.
Comment #14
mparker17The changes in this issue were released in elasticsearch_connector-9.0.0-alpha3, and elasticsearch_connector-8.0.0-alpha7