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
Widening return type hint of SimpleCacheDecorator::translateThrowable method #169
Conversation
…rowable method Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing out that issue.
Could you please also create a failing test case? There should be no need of the filesystem adapter to trigger this method.
…pleCacheDecorator::translateThrowable method Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
…anslateThrowable method Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
…cheDecorator::translateThrowable method Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just a little nitpick regarding the import statement.
…erface on SimpleCacheDecorator class Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Thanks, @mariojrrc |
Description
Tell us about why this change is necessary:
Are you fixing a bug or providing a failing unit test to demonstrate a bug?
no
How do you reproduce it?
Set up a Filesystem adapter and try to call has/get/set methods of Laminas\Cache\Psr\SimpleCache\SimpleCacheDecorator passing an invalid key such as '127.0.0.1'
What did you expect to happen?
It should throws the Laminas\Cache\Psr\SimpleCache\SimpleCacheInvalidArgumentException with message "The key '127.0.0.1' doesn't match against pattern '/^[a-z0-9_\+\-]*$/Di'"
What actually happened?
It throws a TypeError exception with the following message:
"Return value of Laminas\Cache\Psr\SimpleCache\SimpleCacheDecorator::translateThrowable() must be an instance of Laminas\Cache\Psr\SimpleCache\SimpleCacheException, instance of Laminas\Cache\Psr\SimpleCache\SimpleCacheInvalidArgumentException returned"