-
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
Doctrine\Common metadata drivers reuse #314
Doctrine\Common metadata drivers reuse #314
Conversation
@Ocramius the PR in common has been merged so you can update the submodule to make travis happy |
Purrrrrrrrrrrrrrrfect, will do :) |
Build is passing. Time to get this merged. Please let me know if there is more that should be handled in here. |
@@ -52,7 +52,7 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface |
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 not extend AbstractClassMetadataFactory? This gets rid of most the code!
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.
When I started working on this PR you told me this would happen somewhen later.. I can include that anyway :)
Build is not really broken, travis halted somehow on one of the environments... |
*/ | ||
protected function doLoadMetadata($class, $parent, $rootEntityFound) | ||
{ | ||
throw new \LogicException( |
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.
Had to introduce this dirty fix because of
- https://github.com/doctrine/doctrine2/blob/beae0865dbe7416f2639100c45dcb477b734af9d/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L329
- https://github.com/doctrine/doctrine2/blob/beae0865dbe7416f2639100c45dcb477b734af9d/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L337
These steps cannot be reproduced within doLoadMetadata
with the given parameters, and patching Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory
didn't work either...
Ideas?
@Ocramius Can you rebase (and perhaps squash?) the PR? @beberlei @guilhermeblanco Can you look at it? I think it's a nice internal refactoring to make it in 2.3. Common is already up to date for this. |
@asm89 I can do, didn't yet find a decent solution for #314 (comment) though. |
@asm89 rebased, but the PR Still needs doctrine/common#131 and some code could be removed with doctrine/common#138 |
Failures seem to be completely unrelated with the modified code (maybe because I'm using latest doctrine/common master):
|
Have you rebased to latest master? |
@beberlei yep. Will give it a spin when at home again, but I'm pretty sure everything was based on latest master(s) (common/orm) |
/** | ||
* @param EntityManager $$em | ||
* @param EntityManager $em | ||
* @return void |
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.
you should remove the @return void
here
@stof thx for stoffing it, I'm fixing asap :) |
@beberlei @guilhermeblanco @asm89 This can be merged |
Does this break DoctrineBundle with references to drivers? If yes then we should prepare a commit for thta, otherwise i like it very much and +1 for merg enow |
* @param ClassMetadataInfo $metadata | ||
* @param ClassMetadata $metadata | ||
* @throws MappingException | ||
* @return |
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.
you should remove this empty @return
if the method does not return anything, and fix it otherwise
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.
Will fix later today, but at least this is done :)
I think it should work properly in DoctrineBundle as the classes have not changed (only the parent classes have been moved, and the methods are the same) |
@guilhermeblanco rebased |
…istence\Mapping\Driver\MappingDriver
SimplifiedXmlDriver and SimplifiedYamlDriver are still not valid after this commit
…n\Persistence\Mapping\Driver\FileDriver
…\Driver\AnnotationDriver
Interface has been moved to Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
Interface has been moved to Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
…g\Driver\FileDriver instead
…o the old Driver interface
Those exceptions are now in the Common\Persistence\Mapping namespace
… and removing duplicate docs.
Doctrine\Common metadata drivers reuse
This PR is strictly related with doctrine/common#98, doctrine/common#131 and doctrine/common#150 and tests won't pass until the doctrine-common submodule points to a merged version of it (will do so later, so please don't merge now ).
Basically, I just stripped any code duplicate of what already available in dcom master under Doctrine\Common\Persistence\Mapping\Driver.
Tests are OK on my environment when using the new commons submodule.
(This is a cleanup for #263, where I sadly did pull from the remote branch after rebasing)