$symbolAnnotations =
new \
ReflectionProperty($docBlock, 'symbolAnnotations'
);
$symbolAnnotations->
setAccessible(true
);
// Exclude internal classes; PHPUnit 9.1+ is picky about tests covering, say, a \RuntimeException
$covers =
array_filter($covers,
function Dstring
$class) { $reflector =
new \
ReflectionClass($class);
return $reflector->
isUserDefined();
});
$symbolAnnotations->
setValue($docBlock,
array_replace($docBlock->
symbolAnnotations(),
[ 'covers' =>
$covers,
]));
}}