public function attach(Registry $registry, $id = '')
    {
        if (!empty($id) || 0 === $id) {

            if (!empty($this->registries[$id])) {

                throw new RegistryException(
                    RegistryException::DUPLICATE_REGISTRATION_ATTEMPT_TEXT,
                    RegistryException::DUPLICATE_REGISTRATION_ATTEMPT_CODE
                );
            }

            $this->registries[$id] = $registry;

        } else {

            $this->registries[] = $registry;
        }
    }