protected function setNamespaces($namespaces) { if ($this->namespaces instanceof \ArrayObject) { $this->namespaces->exchangeArray($namespaces); } else { $this->namespaces = new \ArrayObject($namespaces); } }