Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Render name of alias that already exists in exception message #3139

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion library/Zend/ServiceManager/ServiceManager.php
Expand Up @@ -630,7 +630,11 @@ public function setAlias($alias, $nameOrAlias)
}

if ($this->allowOverride === false && $this->has(array($cAlias, $alias), false)) {
throw new Exception\InvalidServiceNameException('An alias by this name already exists');
throw new Exception\InvalidServiceNameException(sprintf(
'An alias by the name "%s" or "%s" already exists',
$cAlias,
$alias
Copy link
Member

Choose a reason for hiding this comment

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

should cover $cAlias too

Copy link
Member Author

Choose a reason for hiding this comment

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

Shall I fix something here?

));
}

$this->aliases[$cAlias] = $nameOrAlias;
Expand Down