Issue #3488179 follow-up by alexpott: RecipeConfigurator::getIncludedRecipe() should statically cache recipe objects to avoid performance problems

merge-requests/10276/head
Alex Pott 2024-11-19 16:05:36 +00:00
parent 00a3f6e424
commit e2a92ae248
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
1 changed files with 4 additions and 4 deletions

View File

@ -133,15 +133,15 @@ final class InputConfigurator {
* constraints.
*/
public function collectAll(InputCollectorInterface $collector, array &$processed = []): void {
if (is_array($this->values)) {
throw new \LogicException('Input values cannot be changed once they have been set.');
}
// Don't bother collecting values for a recipe we've already seen.
if (in_array($this->prefix, $processed, TRUE)) {
return;
}
if (is_array($this->values)) {
throw new \LogicException('Input values cannot be changed once they have been set.');
}
// First, collect values for the recipe's dependencies.
/** @var \Drupal\Core\Recipe\Recipe $dependency */
foreach ($this->dependencies->recipes as $dependency) {