From 04d8852932301785d07b3fa966cbad8eaacdcf30 Mon Sep 17 00:00:00 2001 From: Eli Hovis Date: Tue, 6 Feb 2024 11:50:36 -0500 Subject: [PATCH] Fix failing tests --- Model/ModelRegistry.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Model/ModelRegistry.php b/Model/ModelRegistry.php index 625621293..33a2a41c4 100644 --- a/Model/ModelRegistry.php +++ b/Model/ModelRegistry.php @@ -132,10 +132,12 @@ private function generateModelName(Model $model): string } if ($i > 1) { - $this->logger->info(sprintf('Can not assign a name for the model, the name "%s" is now being used %s times', $base, $i), [ - 'model' => $this->modelToArray($model), - 'taken_by' => $this->modelToArray($this->registeredModelNames[$base]), - ]); + if (isset($this->registeredModelNames[$base])) { + $this->logger->info(sprintf('Can not assign a name for the model, the name "%s" is now being used %s times', $base, $i), [ + 'model' => $this->modelToArray($model), + 'taken_by' => $this->modelToArray($this->registeredModelNames[$base]), + ]); + } } return $name; }