Reflection, list of properties, list of attributes given that there is no "hasAttribute"... yeah, that's about right.
You could streamline the attribute search with a quick array_filter instead of a foreach:
$hasAttr = array_filter($propReflect->getAttributes(), fn($attr) => $attr->getName() === RankedListAttribute::class);