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:
@ -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;
|
||||
|
Reference in New Issue
Block a user