Avoid calling array_combine if migration list is empty. #55

Merged
merged 1 commit into from Nov 21, 2011

Conversation

Projects
None yet
2 participants
Contributor

simensen commented Nov 21, 2011

This is a quick patch to avoid a Warning being thrown on array_combine() if $this->migrations contains no entries.

This behavior was noted in #47. Although the usage was incorrect (assuming '' would migrate down instead of 0) the warning should probably be avoided.

I also thought I could put:

if (!count($this->migrations)) { return array(); }

... but I am not sure that we actually need to run the other stuff. Since $allVersions is going to be an empty array I'd assume not, but someone who knows better might be able to verify that. This was just a safer way to go without knowing all of the ramifications of short circuiting the rest of the method.

beberlei merged commit 914bfd1 into doctrine:master Nov 21, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment