How to get the destination nid from an URL object In a preprocess function I want to access the destination node id via the URL object
I cannot find any method that will return the node id for me but I can clearly see that it holds the node id. (see attached)

Any idea how I can get the node id without going the long way of generating it from the URL path?
Looks like you're using the latest Devel, 4.0.1, which sadly currently doesn't show the available methods tab unless you patch it.
If you had the available methods tab, you would've seen that you can retrieve using the public method getRouteParameters
$nid = $url_object-&gt;getRouteParameters()['node'];