Skip to content

Commit

Permalink
More verbose error for same alias exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nilportugues committed Oct 20, 2015
1 parent 817bdad commit 21c18ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mapping/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ public function __construct(array $mappings = null)
$mapping = $this->buildMapping($mappedClass);

if (false === empty($this->aliasMap[$mapping->getClassAlias()])) {

throw new MappingException(
'Class with the same name already present. Please add an alias or change an existing one.'
sprintf(
'Class with name \'%s\' already present, used by \'%s\'. Please add an alias for \'%s\' or change an existing one.',
$mapping->getClassAlias(),
$this->aliasMap[$mapping->getClassAlias()],
$mapping->getClassName()
)
);
}

Expand Down

0 comments on commit 21c18ea

Please sign in to comment.