When using the method getAttributes() to fetch attributes based on a parent class, the proper flag constant is ReflectionAttribute::IS_INSTANCEOF (which equals 2 as mentionned by sergiolibe).
<?php
$reflectionClass->getAttributes(SomeParentAttribute::class, ReflectionAttribute::IS_INSTANCEOF);
?>