Skip to content

Commit

Permalink
remove name sub-collision logging
Browse files Browse the repository at this point in the history
  • Loading branch information
emhovis committed Feb 6, 2024
1 parent ebe6f59 commit 7fdcec5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Model/ModelRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ private function generateModelName(Model $model): string
);
$i = 1;
while (\in_array($name, $names, true)) {
if (isset($this->registeredModelNames[$name])) {
$this->logger->info(sprintf('Can not assign a name for the model, the name "%s" has already been taken.', $name), [
'model' => $this->modelToArray($model),
'taken_by' => $this->modelToArray($this->registeredModelNames[$name]),
]);
}
++$i;
$i++;
$name = $base.$i;
}

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]),
]);
}
return $name;
}

Expand Down

0 comments on commit 7fdcec5

Please sign in to comment.