1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-06-18 15:49:44 +02:00

Fix exception to display the proper Collection name

This commit is contained in:
Mike Almond
2013-08-13 14:54:05 -04:00
parent c11336485b
commit af8a447dea

View File

@ -37,11 +37,14 @@ class DebugBar implements ArrayAccess
* Adds a data collector
*
* @param DataCollectorInterface $collector
*
* @throws DebugBarException
* @return $this
*/
public function addCollector(DataCollectorInterface $collector)
{
if (isset($this->collectors[$collector->getName()])) {
throw new DebugBarException("'$name' is already a registered collector");
throw new DebugBarException("'{$collector->getName()}' is already a registered collector");
}
$this->collectors[$collector->getName()] = $collector;
return $this;