You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator is not marked as @internal, it expects a child class to implement the createLocatedSource() method.
In turn, the createLocatedSource() method has a return type of Roave\BetterReflection\SourceLocator\Located\LocatedSource|null, and Roave\BetterReflection\SourceLocator\Located\LocatedSource which is marked as @internal.
This PR
Removes the @internal from Roave\BetterReflection\SourceLocator\Located\LocatedSource's docblock
This is more like an annoyance, when writing custom source locators that extend from Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator, than an issue, as static analysis flags one is using an internal class.
Feel free to reject this PR, or, maybe, mark Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator as @internal, in case this change is not desirable.
Just in case, the Roave\BetterReflection\SourceLocator\Type\SourceLocator interface expects an implementing class to implement its locateIdentifier() method, which, in turn, has a return type of Roave\BetterReflection\Reflection\Reflection|null.
Roave\BetterReflection\Reflection\Reflection is also marked as @internal.
If we want to make this public, perhaps an interface would be better 🤔
I'd originally marked it @internal as it's a bit of a detail; it was originally a value object of sorts, but wasn't sure about the best public API for it.
That said, I understand the OP concern; I noticed the same in fact when consuming this in Roave/BackwardCompatibilityChecker - not actually sure why Psalm hasn't flagged that there, possibly because the top level Roave namespace is the same.
Given that LocatedSource is indeed returned and used by various public API in Better Reflection, and the library is much more mature now, I personally wouldn't be opposed to adding this as part of the public API (i.e. removing @internal, as proposed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While
Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocatoris not marked as@internal, it expects a child class to implement thecreateLocatedSource()method.In turn, the
createLocatedSource()method has a return type ofRoave\BetterReflection\SourceLocator\Located\LocatedSource|null, andRoave\BetterReflection\SourceLocator\Located\LocatedSourcewhich is marked as@internal.This PR
@internalfromRoave\BetterReflection\SourceLocator\Located\LocatedSource's docblockThis is more like an annoyance, when writing custom source locators that extend from
Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator, than an issue, as static analysis flags one is using an internal class.Feel free to reject this PR, or, maybe, mark
Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocatoras@internal, in case this change is not desirable.