-
-
Notifications
You must be signed in to change notification settings - Fork 72
Decouple from annotations #246
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
Conversation
This is consistent with other packages such as doctrine/dbal
acbc75e
to
648bcc2
Compare
lib/Doctrine/Persistence/Mapping/Driver/ColocatedMappingDriver.php
Outdated
Show resolved
Hide resolved
f0ce492
to
10a12d6
Compare
ping @derrabus 🙏 |
lib/Doctrine/Persistence/Mapping/Driver/ColocatedMappingDriver.php
Outdated
Show resolved
Hide resolved
* @return self | ||
*/ | ||
public static function pathRequired() | ||
public static function pathRequired(string $driverClassName) |
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.
This is a BC break. Shall we add a new named constructor (e.g. pathRequiredForDriver
) instead?
*/ | ||
public function testGetAllClassNames(string $path): void | ||
{ | ||
$driver = new MyDriver($path); |
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.
Shall we move the constructor call into a protected method that AnnotationDriverTest
can override?
* @param Reader $reader The AnnotationReader to use, duck-typed. | ||
* @param string|string[]|null $paths One or multiple paths where mapping classes can be found. | ||
*/ | ||
public function __construct($reader, $paths = null) |
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.
Should the constructor trigger a runtime deprecation?
10a12d6
to
14b1eab
Compare
14b1eab
to
6b12f2b
Compare
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.
I'm sorry I'm late to the party, left few minor comments
The Doctrine Persistence project offers a few base implementations that make it easy to implement your own XML, | ||
Annotations or YAML drivers. | ||
The Doctrine Persistence project offers a few base implementations that | ||
make it easy to implement your own XML, Attributes or YAML drivers. |
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.
Attributes, or YAML
|
||
This driver requires the ``doctrine/annotations`` project. You can install it with composer. | ||
This driver requires the ``doctrine/annotations`` project and is | ||
deprecated because of that. |
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.
I'd add a note about attributes superseding annotations
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.
Also why removing the docs below? The feature is deprecated but documentation is still valuable :)
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.
I think it feels weird to deprecate a feature yet help people build on it. I thought I would make it harder for people to shoot themselves in the foot.
/** | ||
* The ColocatedMappingDriver reads the mapping metadata located near the code. | ||
*/ | ||
trait ColocatedMappingDriver |
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.
why trait instead of an abstract class?
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.
There's a resolved comment about that in this PR.
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.
Ah thanks, haven't seen that :)
Closes #217