$styleNodes cannot be false here due to the type hinting. If we use $xpath as the parameter, this check would make sense again.

I'd also prefer this check to be a guard clause instead, i.e.:

if ($styleNodes === FALSE) {
  return '';
}