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

Widening return type hint of SimpleCacheDecorator::translateThrowable method #169

Merged
merged 7 commits into from Nov 7, 2021

Conversation

mariojrrc
Copy link
Contributor

Q A
Bugfix yes

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"

  • TARGET THE 2.13.x BRANCH

…rowable method

Signed-off-by: Mario Costa <mariojr.rcosta@gmail.com>
@boesing boesing added the Bug Something isn't working label Oct 25, 2021
@boesing boesing added this to the 2.13.1 milestone Oct 25, 2021
Copy link
Member

@boesing boesing left a 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.

src/Psr/SimpleCache/SimpleCacheDecorator.php Outdated Show resolved Hide resolved
…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>
Copy link
Member

@boesing boesing left a 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.

src/Psr/SimpleCache/SimpleCacheDecorator.php Outdated Show resolved Hide resolved
@boesing boesing added the hacktoberfest-accepted Issues/Pull-Requests which can be fixed during Hacktoberfest: https://hacktoberfest.digitalocean.com label Oct 25, 2021
mariojrrc and others added 2 commits October 25, 2021 11:51
…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>
@boesing boesing changed the title fix: removes return type hint of SimpleCacheDecorator::translateThrowable method Widening return type hint of SimpleCacheDecorator::translateThrowable method Nov 7, 2021
@boesing boesing merged commit 977a5b6 into laminas:2.13.x Nov 7, 2021
@boesing
Copy link
Member

boesing commented Nov 7, 2021

Thanks, @mariojrrc
Sorry that it took that long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working hacktoberfest-accepted Issues/Pull-Requests which can be fixed during Hacktoberfest: https://hacktoberfest.digitalocean.com
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants