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

Add configurationClass option #46

Merged
merged 10 commits into from Feb 25, 2019

Conversation

2 participants
@aleswita
Copy link
Contributor

aleswita commented Feb 23, 2019

all you can see in diff

aleswita added some commits Feb 23, 2019

fs
fs
$config = $this->validateConfig($this->defaults['configuration'], $this->config['configuration']);
$config = Helpers::expand($config, $builder->parameters);
$configurationClass = $this->config['configurationClass'];
if ($configurationClass !== Configuration::class && !is_subclass_of($configurationClass, Configuration::class)) {

This comment has been minimized.

@f3l1x

f3l1x Feb 24, 2019

Member

Have you considered is_a (http://php.net/manual/en/function.is-a.php)?

if (!is_a($configurationClass, Configuration::class)) {
// throw
}

This comment has been minimized.

@aleswita

aleswita Feb 25, 2019

Author Contributor

tnx for hint

],
]);
}, self::class . __METHOD__);
/** @var Container $container */
$container = new $class();
self::assertInstanceOf(DummyEntityManagerDecorator::class, $container->getByType(DummyEntityManagerDecorator::class));
self::assertInstanceOf(DummyConfiguration::class, $container->getByType(DummyConfiguration::class));

This comment has been minimized.

@f3l1x

f3l1x Feb 24, 2019

Member

Please, add also test for the exception case. Thanks.

This comment has been minimized.

@aleswita

aleswita Feb 25, 2019

Author Contributor

Added.. can you help make test without warnings about deprecated anotations? I have no experience with PHPUnit.

This comment has been minimized.

@f3l1x

f3l1x Feb 25, 2019

Member

Replace annotation with method call.

9d9413a#diff-9bd459dedc49d13726a368c5307d2fcaR41

This comment has been minimized.

@aleswita

aleswita Feb 25, 2019

Author Contributor

done :-)

@f3l1x f3l1x merged commit 8841998 into nettrine:master Feb 25, 2019

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@f3l1x

This comment has been minimized.

Copy link
Member

f3l1x commented Feb 25, 2019

Awesome. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.