Skip to content
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

Set dependencyFactory before configure is called in DoctrineCommand #1043

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

jkrzefski
Copy link
Contributor

@jkrzefski jkrzefski commented Aug 9, 2020

Q A
Type bug
BC Break no
Fixed issues

Summary

While reading through the code I found this piece here and I figured, it would never actually do anything with the way things are set up. The constructor always sets the value for $dependencyFactory only after calling its parent, so until then $dependencyFactory is considered null. The parent's constructor in turn calls the configure method which checks if $dependencyFactory is null.

I have switched the assignment of $dependencyFactory with the call to the parent's constructor, so that the condition in the configure method actually does something depending on the presence of a $dependencyFactory.

I consider this a breaking change, since this can potentially lead to one less input option for a doctrine command, thus changing the command definition and breaking scripts that provide this option.

@greg0ire greg0ire changed the base branch from master to 3.0.x August 9, 2020 09:07
@greg0ire greg0ire added the Bug label Aug 9, 2020
@greg0ire
Copy link
Member

greg0ire commented Aug 9, 2020

@jkrzefski jkrzefski force-pushed the patch-1 branch 2 times, most recently from 3d22bc1 to 574acbf Compare September 6, 2020 18:14
@jkrzefski
Copy link
Contributor Author

@greg0ire I added a test case and made sure it fails without my change. Please take a look at it. And thank you for your patience.

@greg0ire
Copy link
Member

greg0ire commented Sep 6, 2020

Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble.

How to do that?

  1. git rebase -i origin/3.0.x, assuming origin is a git remote that points to this repository, and not your fork. If you're not sure what your remotes are, run git remote -vvv, there should be your fork and the holy/reference/base/origin/whatever-you-call-it repository.
  2. A window will show up with many lines, replace pick with fixup on every line but the first one
  3. Close your editor, git should do its magic, and you should end up with one commit
  4. Use git push --force to overwrite what you already push. Don't forget the --force option otherwise git will try to merge both things together.

@jkrzefski
Copy link
Contributor Author

Rebased and squashed.

@goetas goetas closed this Nov 28, 2020
@goetas goetas reopened this Nov 28, 2020
@goetas goetas force-pushed the patch-1 branch 2 times, most recently from f3cbfed to 60a015d Compare November 28, 2020 18:34
@goetas
Copy link
Member

goetas commented Nov 28, 2020

@SenseException I have rebased it and added the db-configuration check.

@goetas goetas added this to the 3.0.2 milestone Nov 28, 2020
@goetas
Copy link
Member

goetas commented Nov 29, 2020

@SenseException makes sense! code updated

@goetas goetas merged commit f1b38c7 into doctrine:3.0.x Nov 30, 2020
@goetas
Copy link
Member

goetas commented Nov 30, 2020

thanks everyone!

@jkrzefski jkrzefski deleted the patch-1 branch July 10, 2021 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants