Skip to content

Orchestrate Sites CLI command generating a huge amount of implicit float conversion warnings on PHP >= 8.1 #399

Open
@cristianobaptista

Description

@cristianobaptista

Desired Behavior

We would like to not have warnings in our logs about implicit float conversion on PHP >= 8.1.

Actual Behavior

The $num_groups variable in Automattic\WP\Cron_Control\CLI\Orchestrate_Sites::list() sometimes results in a float that is later used for the modulo operation at the end of the code block:

https://github.com/Automattic/vip-go-mu-plugins/blob/27bdb049240dbdee962ad3ff008581910043eb05/cron-control/includes/wp-cli/class-orchestrate-sites.php#L41-L54

Since $num_groups is not explicitly converted to an integer, our logs get completely clogged with warnings about this code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions