Skip to content

Conversation

greg0ire
Copy link
Member

Closes #217

This is consistent with other packages such as doctrine/dbal
@greg0ire greg0ire force-pushed the decouple-from-annotations branch from acbc75e to 648bcc2 Compare February 26, 2022 16:24
@greg0ire greg0ire added this to the 2.4.0 milestone Feb 26, 2022
@greg0ire greg0ire force-pushed the decouple-from-annotations branch 2 times, most recently from f0ce492 to 10a12d6 Compare March 1, 2022 12:21
@greg0ire greg0ire requested a review from derrabus March 1, 2022 12:26
@greg0ire
Copy link
Member Author

greg0ire commented Mar 3, 2022

ping @derrabus 🙏

* @return self
*/
public static function pathRequired()
public static function pathRequired(string $driverClassName)
Copy link
Member

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);
Copy link
Member

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)
Copy link
Member

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?

@greg0ire greg0ire force-pushed the decouple-from-annotations branch from 14b1eab to 6b12f2b Compare March 3, 2022 22:53
@greg0ire greg0ire requested a review from derrabus March 3, 2022 22:55
@greg0ire greg0ire merged commit 3d3dad9 into doctrine:2.4.x Mar 4, 2022
Copy link
Member

@malarzm malarzm left a 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.
Copy link
Member

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.
Copy link
Member

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

Copy link
Member

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 :)

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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 :)

@greg0ire greg0ire deleted the decouple-from-annotations branch March 12, 2022 19:09
nanasess added a commit to nanasess/ec-cube that referenced this pull request Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants