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

Allow to change configurations in the dependency factory #959

Merged
merged 8 commits into from
Apr 23, 2020

Conversation

goetas
Copy link
Member

@goetas goetas commented Apr 8, 2020

Q A
Type feature (re introduce feature removed in previous pull requirests)
BC Break -
Fixed issues doctrine/DoctrineMigrationsBundle#311

Summary

Currently the Dependency Factory contains already all the configurations.
This allows to change configurations (not db connection or entity manager) even if they are already specified in the Dependency Factory

@goetas goetas changed the title Allow to change configurations in the dependency factory [WIP] Allow to change configurations in the dependency factory Apr 8, 2020
@goetas goetas force-pushed the allow-custom-configs-at-runtime branch from 4dd77ad to 7684400 Compare April 9, 2020 08:07
@goetas goetas added this to the 3.0.0 milestone Apr 9, 2020
@goetas goetas force-pushed the allow-custom-configs-at-runtime branch from 7684400 to a83b5d3 Compare April 21, 2020 11:30
@goetas goetas changed the title [WIP] Allow to change configurations in the dependency factory Allow to change configurations in the dependency factory Apr 22, 2020
@goetas
Copy link
Member Author

goetas commented Apr 22, 2020

Functionality wise this has been tested in doctrine/DoctrineMigrationsBundle#311 (comment)

@@ -63,6 +63,9 @@ protected function initialize(InputInterface $input, OutputInterface $output) :
);
$connectionLoader = new ConfigurationFile((string) $input->getOption('db-configuration'));
$this->dependencyFactory = DependencyFactory::fromConnection($configurationLoader, $connectionLoader);
} elseif (is_string($input->getOption('configuration'))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please call $input->getOption('configuration') once and use a variable?

@@ -91,6 +91,7 @@ public function testConnection() : void

self::assertSame($this->connection, $di->getConnection());
self::assertFalse($di->hasEntityManager());
self::assertTrue($di->isFrozen());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing explicitly if the DependencyFactory. Does this mean that in the other tests it should be checked if it isn't frozen in case this is relevant for regressions?

@goetas goetas force-pushed the allow-custom-configs-at-runtime branch from f6ca1e8 to 2453b7e Compare April 23, 2020 07:16
@goetas
Copy link
Member Author

goetas commented Apr 23, 2020

@SenseException both notes you've left have been addressed in the last two commits

@alcaeus alcaeus requested a review from SenseException April 23, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants