Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add int casting to getLastRestart method #298

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

glioympas
Copy link
Contributor

@glioympas glioympas commented Jul 12, 2024

When cache driver is Redis and you retrieve a value from the store, it's automatically string type because of how Redis retrieves these values. Even if key "laravel-kafka:consumer:restart" is stored as an integer on RestartConsumersCommand, when retrieving, Redis will return that as a string.

The problem is the combination of strict_types=1 and type hinting. PHP can't automatically convert that to an integer, so there is a type error exception.

On this PR we cast the result of getLastRestart, so it's always an integer.

@mateusjunges mateusjunges merged commit 8986acd into mateusjunges:master Jul 12, 2024
6 checks passed
@mateusjunges
Copy link
Owner

Thank you @glioympas!

@panVag
Copy link

panVag commented Jul 15, 2024

@mateusjunges can we please cut a new minor version for this one?

@duckarcher
Copy link

+1 for the above. thanks in advance @mateusjunges. i will use this new version as long as it's out.

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.

4 participants