Skip to content

Conversation

@orlandothoeny
Copy link
Contributor

I noticed that PHPUnit reports a call to str_replace() in a way that is deprecated. It looks to me, that this shouldn't ever happen when the code actually executes. I added type information to tell PHP that the str_replace() $subject is never null.

I have added cannotBeEmpty() to the path config (https://github.com/orlandothoeny/RateLimitBundle/blob/c4ece31865beec1a59b9464e27f785ed98425737/DependencyInjection/Configuration.php#L118-L118), I'm not 100% sure about that. Since its technically a BC break? But I guess passing an empty value is not supported.

Gets rid of the following when running the tests:

Remaining self deprecation notices (1)

  1x: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
    1x in RateLimitAnnotationListenerTest::testDispatchIsCalledIfThePathLimitProcessorReturnsARateLimit from Noxlogic\RateLimitBundle\Tests\EventListener

…ytaph#3 ($subject)

Remaining self deprecation notices (1)

  1x: str_replace(): Passing null to parameter jaytaph#3 ($subject) of type array|string is deprecated
    1x in RateLimitAnnotationListenerTest::testDispatchIsCalledIfThePathLimitProcessorReturnsARateLimit from Noxlogic\RateLimitBundle\Tests\EventListener
@orlandothoeny orlandothoeny force-pushed the fix/str-replace-deprecation branch from c4ece31 to 5578dc5 Compare November 17, 2025 16:16
…ytaph#3 ($subject)

Remaining self deprecation notices (1)

  1x: str_replace(): Passing null to parameter jaytaph#3 ($subject) of type array|string is deprecated
    1x in RateLimitAnnotationListenerTest::testDispatchIsCalledIfThePathLimitProcessorReturnsARateLimit from Noxlogic\RateLimitBundle\Tests\EventListener
@goetas goetas merged commit 057ad74 into jaytaph:main Nov 17, 2025
24 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.

2 participants