-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Introduce DoctrineSetup
as a replacement for Setup
#9443
Conversation
e360316
to
5ac2847
Compare
/** | ||
* Creates a configuration with a yaml metadata driver. | ||
* | ||
* @deprecated YAML metadata mapping is deprecated and will be removed in 3.0 |
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.
It felt a bit odd to introduce a method and instantly deprecate it. I decided to add the method to allow switching to a PSR-6 cache before migrating the whole YAML mapping configuration to XML or 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.
This reminds me that we should think about deprecating annotations as well… but maybe it's too early?
/** | ||
* Creates a configuration with a yaml metadata driver. | ||
* | ||
* @deprecated YAML metadata mapping is deprecated and will be removed in 3.0 |
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 reminds me that we should think about deprecating annotations as well… but maybe it's too early?
5ac2847
to
4bac151
Compare
4bac151
to
50c73a2
Compare
* 2.12.x: Introduce DoctrineSetup as a replacement for Setup (doctrine#9443) Introduce __unserialize behaviour in docs (doctrine#9390) Adapt test logic to PHP and SQLite II (doctrine#9442) Use the identify generator strategy Added php 8.1 to CI Psalm 4.19.0, PHPStan 1.4.3 (doctrine#9438) Ignore PHPUnit result cache everywhere (doctrine#9425)
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.
Are there no uses of Setup in the docs folder?
I am wondering if the name shouldbe ORMSetup and if in the spirit of DriverManager in DBAL we should move it to top lebel.
I totally forgot about the docs, thanks for the hint. #9448
Yeah, why not. 🤔 I'll look into it tomorrow. 😴 |
The
Setup
class is a collection of static methods for bootstrapping a ORM configuration with recommended settings. At least that's my understanding of that class. In applications where the ORM is configured through some kind of framework integration (like DoctrineBundle), that class is more or less irrelevant.The
Setup
class as of today operates on Doctrine Cache instances. Since the whole ORM is now able to operate on PSR-6 we should do something about it. Unfortunately, since theSetup
class is not final, altering all method signatures is quite difficult, so I decided to deprecate the whole class and add a new class namedDoctrineSetup
as replacement.Key differences between the two setup classes:
final
which should make future changes to that class easier.useSimpleAnnotationReader
flag is not supported anymore.Furthermore, I decided to move the
newDefaultAnnotationDriver()
method from theConfiguration
class to the newDoctrineSetup
class. That method does not really mutate the configuration, it is a simple factory for the annotation driver.DoctrineSetup
feels like the better place for it.