Skip to content

[12.x] cast Batch::progress() return value to int#58767

Merged
taylorotwell merged 2 commits intolaravel:12.xfrom
zjbarg:fix/batch-progress-return-value
Feb 12, 2026
Merged

[12.x] cast Batch::progress() return value to int#58767
taylorotwell merged 2 commits intolaravel:12.xfrom
zjbarg:fix/batch-progress-return-value

Conversation

@zjbarg
Copy link
Contributor

@zjbarg zjbarg commented Feb 11, 2026

The documented return type for the Batch::progress() method is integer but the round function returns float even though it doesn't contain any decimals.

This will cause a TypeError when the value is float and is consumed by a function expecting an integer in strict mode declare(strict_type=1);

To resolve this issue, the rounded value should be cast to an integer.

Edit:

  • return value update to int<0, 100> - suggested by @shaedrich

@taylorotwell taylorotwell merged commit c374cce into laravel:12.x Feb 12, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants