From af8a447dea94d07652c445b7815ac470473997bd Mon Sep 17 00:00:00 2001 From: Mike Almond Date: Tue, 13 Aug 2013 14:54:05 -0400 Subject: [PATCH] Fix exception to display the proper Collection name --- src/DebugBar/DebugBar.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DebugBar/DebugBar.php b/src/DebugBar/DebugBar.php index 901793f..fb56c8a 100644 --- a/src/DebugBar/DebugBar.php +++ b/src/DebugBar/DebugBar.php @@ -35,13 +35,16 @@ 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;