🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

argument.invalidConstant changes valid RoundingMode::HalfAwayFromZero enum #14716

Description

@CicerBro

Bug report

Just updated to 2.2.0 and ran PHPStan again, which wanted to change:

$leaveOver = (int) round($totalCount / 2, 0, \RoundingMode::HalfTowardsZero);
to
$leaveOver = (int) round($totalCount / 2, 0, PHP_ROUND_HALF_DOWN);

The former being the modern way: https://www.php.net/manual/en/function.round.php

Rector wants to change this back again to the enum btw. Which I think is the right choice here.

Code snippet that reproduces the problem

https://phpstan.org/r/4d705edc-f164-4474-9ff4-661aa4c7da69

Expected output

See above

Did PHPStan help you today? Did it make you happy in any way?

No response

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