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

Command icon 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

pfrenssen created an issue. See original summary.

pfrenssen’s picture

Issue tags: +PHP 8.5

pfrenssen’s picture

Status: Active » Needs review

claudiu.cristea made their first commit to this issue’s fork.

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

Legit

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed

Merged. Thank you

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.