Skip to content

Conversation

paullallier
Copy link
Contributor

I suspect this has no impact since everywhere using $context['uri_variables_map'] falls back on $operation->getUriVariables() anyway.

Q A
Branch? 3.1 (or 3.0 if still getting bugfixes)
Tickets New issue
License MIT
Doc PR n/a

….php

I suspect this has no impact since everywhere using $context['uri_variables_map'] falls back on $operation->getUriVariables() anyway.
@dunglas dunglas changed the title [typo] fix misnamed, so unused, variable in UriVariablesResolverTrait fix: misnamed, so unused, variable in UriVariablesResolverTrait Oct 19, 2023
Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Your patch should improve performance.

@paullallier
Copy link
Contributor Author

I suspect we could remove the call to $operation->getUriVariables() in these two functions too, which is probably more of a performance improvement. I wasn't sure enough to do it though. What do you think? I'm not certainly enough that $context['uri_variables_map'] will always exist when these functions are called.

$uriVariablesDefinitions = $operation->getUriVariables() ?? [];

$uriVariablesDefinitions = $operation->getUriVariables() ?? [];

@soyuka
Copy link
Member

soyuka commented Oct 19, 2023

In the UriVariblesConverter we want to get $operation->getUriVariables() we can't be sure the $context exists.

@soyuka soyuka merged commit 157faaf into api-platform:3.1 Oct 19, 2023
@paullallier paullallier deleted the fix/uri-variables-resolver-typo branch October 19, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants