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

New config property "converterSuffix" #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mike4git
Copy link
Collaborator

This property will be introduced to enable backwards compatibilty to "older" converter declarations.

@mike4git mike4git requested a review from jdreesen May 13, 2024 06:22
@jdreesen
Copy link
Member

What exactly is the problem? What breaks on “old” converter declarations? How do they look?

@@ -28,6 +28,10 @@ private function addConverterSection(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->scalarNode('converterSuffix')
->info('consolidated suffix for all converters')
->defaultValue('')
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change. The default value should be the current one.

Suggested change
->defaultValue('')
->defaultValue('Converter')

@@ -28,6 +28,10 @@ private function addConverterSection(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->scalarNode('converterSuffix')
->info('consolidated suffix for all converters')
Copy link
Member

Choose a reason for hiding this comment

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

This message is misleading. It only configures the suffix of the autowiring alias for converter arguments.

@@ -28,6 +28,10 @@ private function addConverterSection(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->scalarNode('converterSuffix')
Copy link
Member

@jdreesen jdreesen May 13, 2024

Choose a reason for hiding this comment

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

Config parameters should be in "snake_case":

Suggested change
->scalarNode('converterSuffix')
->scalarNode('converter_suffix')

Maybe we should even rename this to be more specific, like argument_autowiring_alias_suffix.

@@ -40,7 +40,7 @@ public function loadInternal(array $mergedConfig, ContainerBuilder $container):
/**
* @param array<string, mixed> $config
*/
private function registerConverterConfiguration(string $id, array $config, ContainerBuilder $container): void
private function registerConverterConfiguration(string $id, array $config, ContainerBuilder $container, ?string $converterSuffix): void
Copy link
Member

Choose a reason for hiding this comment

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

I guess this is not nullable when there's a default value defined in the config.

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.

None yet

2 participants