Skip to content

Commit 72b6af8

Browse files
committed
fix: implicit conversion from float to int loses precision
1 parent 7e32816 commit 72b6af8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/wp-cli/class-orchestrate-sites.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function list() {
4242
$hosts = $this->get_hosts();
4343

4444
// Use 2 hosts per site.
45-
$num_groups = count( $hosts ) / 2;
45+
$num_groups = (int) ceil( count( $hosts ) / 2 );
4646
if ( $num_groups < 2 ) {
4747
// Every host runs every site.
4848
$this->display_sites();
@@ -69,7 +69,7 @@ private function display_sites( $num_groups = 1, $group = 0 ) {
6969
$all_sites = get_sites( [ 'number' => 10000 ] );
7070
$sites_to_display = [];
7171
foreach ( $all_sites as $index => $site ) {
72-
if ( ! ( $index % $num_groups === $group ) ) {
72+
if ( $index % $num_groups !== $group ) {
7373
// The site does not belong to this group.
7474
continue;
7575
}

0 commit comments

Comments
 (0)