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 parameters in BeanPostProcessor configuration #101

Merged

Conversation

shochdoerfer
Copy link
Member

Allow passing parameters to the BeanPostProcessor configuration in a similar fashion as passing parameters to the Bean configuration.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 94.505% when pulling c3068ac on shochdoerfer:feature/postprocessor-parameters into 9814ec3 on bitExpert:master.

@shochdoerfer shochdoerfer added this to the 0.9.0 milestone Jun 14, 2017
@shochdoerfer shochdoerfer merged commit ae5c04b into bitExpert:master Jun 14, 2017
foreach ($beanAnnotation->getAliases() as $beanAlias) {
$alias = $beanAlias->isTypeAlias() ? (string) $method->getReturnType() : $beanAlias->getName();
if (empty($alias)) {
continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

This if-block seems to be unreachable code, because it looks like an alias name, that can be empty, will throw an exception before the ConfigurationGenerator is reached.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the check mostly for the return type. Potentially it could not be defined at this stage. Maybe it makes sense to move the BeanMethod generation logic upfront which actually checks for the return type.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll try to cover it with a return type test.

Copy link
Contributor

Choose a reason for hiding this comment

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

When I add a method without a return type into BeanConfigurationWithConflictingAliases, the empty check for the alias is covered. If I do the same in BeanConfigurationWithAliases, I get the expected "is missing the return type hint" Exception.

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.

3 participants