BetterReflection icon indicating copy to clipboard operation
BetterReflection copied to clipboard

Enforce `StringSourceLocator` to be built with a `non-empty-string`

Open Ocramius opened this issue 3 years ago • 0 comments

Currently, a StringSourceLocator can be constructed with an empty string, but will crash at runtime when doing so:

https://github.com/Roave/BetterReflection/blob/f3966ba125e3b4db948a240e8b29bc28882623c1/src/SourceLocator/Type/StringSourceLocator.php#L23-L38

We should really get rid of the exception, and instead enforce non-empty-string as input.

Ocramius avatar Dec 26 '21 04:12 Ocramius