protected function getLinkIndex(array $links, $type, $index)
    {
        // If the link index is out of bounds
        if (!is_int($index) || !array_key_exists($index, $links)) {
            throw new OutOfBoundsException(
                sprintf(OutOfBoundsException::INVALID_LINK_TYPE_INDEX_STR, $index, $type),
                OutOfBoundsException::INVALID_LINK_TYPE_INDEX
            );
        }

        return $links[$index];
    }