-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decouple AnnotationDriver from doctrine/annotations #217
Conversation
e34d9b9
to
7b4b467
Compare
ignoreErrors: | ||
# TODO: Remove in 3.0 | ||
- | ||
message: "#^Call to function is_object\\(\\) with array\\<string\\>\\|string\\|null will always evaluate to false\\.$#" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be avoided by adding treatPhpDocTypesAsCertain: false
in the phpstan parameters, which makes phpstan accept cases where a type check is done in the code that validates a type defined only in phpdoc (because phpdoc types are not enforced) while type checks done on a value that passed through a native type are still reported.
Maybe the right solution would be to extract most of the logic to a new parent class that does not use |
7b4b467
to
2210242
Compare
How would you name it? |
@derrabus I don't know. What is the feature actually implemented by that abstract class ? |
If we remove the code that interfaces with doctrine/annotations, we recive an abstract driver that is able to discover class names from filesystem paths.
Yes, possibly. |
If that driver is meant to handle metadata located next to the properties, class names etc. it defines metadata on, how about |
Closing in favor of #246 |
AnnotationDriver
is a helpful utility class for all drivers that read metadata from annotated class files. It's main advantage is the ability to search paths for suitable class files.Unfortunately, it is currently coupled to the doctrine/annotations library. The ORM uses this class for its
AttributeDriver
which feels like a hack currently.I'd like to decouple the class by removing the
$reader
property and making theisTransient()
method abstract in 3.0. This PR prepares the necessary deprecation layer.