/** * @inheritDoc */ public function get(ResourceIdentifierInterface $identifier) { /** @var ResourceInterface $resource */ foreach ($this as $resource) { if ($identifier->isSame($resource->getIdentifier())) { return $resource; } } throw new RuntimeException('No matching resource in collection: ' . $identifier->toString()); }