public function mount(CollectionInterface $collection) { if ($collection instanceof ApiCollection) { $collectionName = $collection->getName(); if (!is_null($collectionName)) { $this->collectionsByName[$collectionName] = $collection; } $this->collectionsByIdentifier[$collection->getIdentifier()] = $collection; /** @var ApiEndpoint $endpoint */ foreach ($collection->getEndpoints() as $endpoint) { $fullIdentifier = $collection->getIdentifier() . ' ' . $endpoint->getIdentifier(); $this->endpointsByIdentifier[$fullIdentifier] = $endpoint; } } return parent::mount($collection); }