Skip to content

Symfony\Component\RateLimiter\Policy\SlidingWindow::getExpirationTime(): Return value must be of type int, float returned #45924

Closed
@georgringer

Description

@georgringer

Symfony version(s) affected

5.4.7

Description

With the commit of symfony/rate-limiter@4716500 the method getExpirationTime changed and now a float is returned but the return type is set to int which produces an exception

How to reproduce

No out of box code available but using microtime(true) returns a float

Possible Solution

type cast like

return (int)($this->windowEndAt + $this->intervalInSeconds - microtime(true));

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions