Problem/Motivation
PHP 8.5 deprecates the non-canonical (boolean) cast alias in favour of (bool). A PHPCompatibility scan of 8.x-1.x reports two occurrences, both in test code:
FILE: tests/src/Functional/TmgmtEntityTestTrait.php ---------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------- 125 | WARNING | The boolean cast is deprecated since PHP 8.5; Use (bool) instead ---------------------------------------------------------------- FILE: src/Tests/EntityTestBase.php ---------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------- 130 | WARNING | The boolean cast is deprecated since PHP 8.5; Use (bool) instead ----------------------------------------------------------------
Steps to reproduce
Run PHPCompatibility against the module with testVersion 8.5.
Proposed resolution
Replace the (boolean) cast with the canonical (bool) in both files.
Note that src/Tests/EntityTestBase.php is already @deprecated (superseded by \Drupal\Tests\tmgmt\Functional\TmgmtEntityTestTrait, so this code on its way out, but it's trivial to fix anyway.
Issue fork tmgmt-3602648
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
pfrenssenComment #4
pfrenssenComment #6
claudiu.cristeaLegit
Comment #8
claudiu.cristeaMerged. Thank you