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

fix: Remove redundant Cache getItem() call in Auth0\SDK\Token\Verifier::getKeySet() #669

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

pkivits-litebit
Copy link
Contributor

@pkivits-litebit pkivits-litebit commented Nov 4, 2022

$item has already been created on line 198: https://github.com/auth0/auth0-PHP/blob/main/src/Token/Verifier.php#L198. We only have to save the value and expiry here.

This change will only get the value of the cache once instead of twice.

$item (although with an empty value) has already been created on line 198: https://github.com/auth0/auth0-PHP/blob/main/src/Token/Verifier.php#L198. We only have to save the value and expiry here.

This change will only (try) to get the value of the cache once instead of twice.
@pkivits-litebit pkivits-litebit requested a review from a team as a code owner November 4, 2022 08:53
@evansims
Copy link
Member

evansims commented Nov 4, 2022

Good catch, @pkivits-litebit! We'll need to address the scope of $item to accommodate this change

@evansims evansims changed the title Remove unnecessary second getItem call fix: Remove redundant Cache getItem() call in Auth0\SDK\Token\Verifier::getKeySet() Nov 7, 2022
@evansims evansims added this to the 8.3.7 milestone Nov 7, 2022
@evansims evansims merged commit 0084336 into auth0:main Nov 7, 2022
github-actions bot pushed a commit that referenced this pull request Nov 7, 2022
…h0\SDK\Token\Verifier::getKeySet()` (#669)

* Remove unnecessary second getItem call

$item (although with an empty value) has already been created on line 198: https://github.com/auth0/auth0-PHP/blob/main/src/Token/Verifier.php#L198. We only have to save the value and expiry here.

This change will only (try) to get the value of the cache once instead of twice.

* fix: Variable scope

Co-authored-by: Evan Sims <evan.sims@okta.com>
@evansims evansims mentioned this pull request Nov 8, 2022
@pkivits-litebit pkivits-litebit deleted the patch-1 branch November 8, 2022 07:35
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