Roave / BetterReflection

:crystal_ball: Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.
MIT License
1.19k stars 131 forks source link

`Roave\BetterReflection\Reflection\ReflectionFunctionAbstract#getStartColumn()` throws `RuntimeException` instead of `Roave\BetterReflection\Util\Exception\NoNodePosition` #1276

Closed Ocramius closed 2 years ago

Ocramius commented 2 years ago

https://github.com/Roave/BetterReflection/blob/55b947fe0b929ec6ec4d40d6b4a37b7e6bf2496b/src/Reflection/ReflectionFunctionAbstract.php#L349-L407

This API should probably throw NoNodePosition, to be more specific?

Would be a minor BC break, since NoNodePosition extends InvalidArgumentException

Ocramius commented 2 years ago

NoNodePosition may be wrong here: a more specific exception type would suffice, though.

By extending RuntimeException, we would also prevent a BC break.

kukulich commented 2 years ago

Naming is hard... Do you have an idea how to name the exception?

Ocramius commented 2 years ago

Maybe CodeLocationMissing or such?