public function addTape(Tape $tape) { if (array_key_exists($tape->getName(), $this->tapes)) { throw new RecorderException(sprintf('A tape with name %s is already registered', $tape->getName())); } $this->tapes[$tape->getName()] = $tape; }