Skip to content

[DependencyInjection] Fix named arguments when using ContainerBuilder before compilation #49077

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

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #49074
License MIT
Doc PR -

@deguif
Copy link
Contributor

deguif commented Feb 1, 2023

With this fix it seems the container linter is not happy anymore:

        <service id="api_platform.doctrine.orm.search_filter" class="ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter" public="false" abstract="true">
            <argument type="service" id="doctrine" />
            <argument>null</argument>
            <argument type="service" id="api_platform.iri_converter" />
            <argument type="service" id="api_platform.property_accessor" />
            <argument type="service" id="logger" on-invalid="ignore" />
            <argument key="$identifiersExtractor" type="service" id="api_platform.identifiers_extractor.cached" on-invalid="ignore" />
            <argument key="$nameConverter" type="service" id="api_platform.name_converter" on-invalid="ignore" />
        </service>

It will generate this error when linting:

 Invalid service "api_platform.doctrine.orm.search_filter": did you forget to add the "$" prefix to argument "nameConverter"?

@nicolas-grekas
Copy link
Member Author

Hi @deguif, please open a dedicated issue with a reproducer.

jlabedo added a commit to jlabedo/ecotone-dev that referenced this pull request Oct 20, 2023
jlabedo added a commit to jlabedo/ecotone-dev that referenced this pull request Oct 20, 2023
dgafka added a commit to ecotoneframework/ecotone-dev that referenced this pull request Oct 23, 2023
* wip

* use same endpoint annotations resolution for gateway proxy

* declare runtime annotation with AttributeDefinition to compile annotations

* refactor InterfaceToCall.php to be compilation friendly

* working container implementation

* enable around interceptors compilation

* enable compilation of statically called method invocation

* fix parameter conversion compilation

* use a different unique container name generation for compatibility

* add missing php-di dependency to Ecotone

* fix phpstan types

* fix positional arguments in php-di

* compilable gateways

* use the new cache configuration

* rename ContainerFactory to ContainerHydrator

* refactor MethodArgumentsFactory.php

* give a common channel resolver with: channels coming from container other channels from legacy

* move container creation in build phase

* wip

* wip

* symfony implementation

* compilable bridge

* run php cs fixer

* lint

* lint

* cleaning

* removing the ContainerHydrator thing

this is handled in the framework

* EcotoneLite container implementation

* Remove FactoryDefinition.php

* moving components to compilable interface

* wip

* compile converters

* wip

* polling consumers compilation

* wip

* wip

* one collector per channel

* fix serializer tests

* wip

* fix behat tests

* Fix event sourcing handler executor

* before send interceptor implementation

* add AsynchronousRunningEndpoint annotation on PollingConsumerBuilder

* fix DefaultHeaderMapper.php

* cleaning

* polling with connection channel

* refactor running polling consumers

* refactor running polling consumers and implement channel adapters

* wip

* add compiler passes

* fix continuous polling for pollling consumers

* add test cases for defined object compiler passs

* fix gateway external container registration

* fixing tests

* in memory container implementation for easier testing

* wip

* implement endpoint list

* all behat tests working

* all symfony behat tests working

* move php-di implementation to LiteApplication package

* fix symfony behat test

* throw on invalid gateway

* wip

* fix resolving external references

* wip

* wip

* begin working on dbal

* register service configuration values

* self defined type descriptors

* fix dbal deduplication

* defined object NullEntrypointGateway

* fix error interceptor precedence 🔨

* fix more dbal tests

* fix behat tests

* introduce Component testing

* refactor ExpressionEvaluationService.php

* fix test

* clean PollingConsumerBuilder.php for review

* logging handler

* defined object wrapper

* fix unit tests

* fix inbound adapter tests

* register console commands

* fix dbal tests

* All Dbal Tests passing 🥳

* wip

* implement gateway list

* fix tests

* fix tests

* fix gateway error channel

* fix router tests

* fix bus routing module tests (seems useless)

* fix SymfonyExpressionEvaluationAdapterTest.php

* fix CallAggregateServiceBuilderTest.php

* fix RepositoryStorageTest.php

* fix SaveAggregateServiceBuilderTest.php

* fix EnricherBuilderTest.php

* fix ServiceActivatorBuilderTest.php

* fix GatewayProxyBuilder.php assertions

* fix Gateway references registration

* implement MessageFilterBuilder.php

* fix tests

* fix TransformerBuilder.php

* fix GatewayProxyBuilderTest.php

* Refactor ServiceActivatorBuilder.php

* implement SplitterBuilder.php

* refactoring

* cleaning interfaces

* cleaning required references

* cleaning required interfaces

* cleaning required interfaces

* cleaning inboundadapter

* cleaning repository builder

* cleaning CollectorChannelInterceptorBuilder.php

* cleaning repository builder

* cleaning

* cleaning CompilableParameterConverterBuilder.php`

* add ServiceConfiguration at build time

* fix ReferenceBuilderTest.php

* introduce MethodInvokerBuilder

* delete old MessagingSystem.php

* changing CompilableParameterConverterBuilder.php interface

* fix test

* fix test

* fix test

* fix ConfigurationVariableBuilder.php

* wip

* fix Event sourcing module

* Event sourcing module testing done

* jms converter

* testing with symfony

* wip

* wip

* wip

* wip

* working polling consumer adapters - core tests OK 💥

* inbound channel adapters could be used in as poller of a message channel (DbalBackedMessageChannel) or directly as consumers

* introduce a DefinitionHelper class for serializing objects

* still on channel adapter

* fix symfony integration

* fix lite app integration

* wip

* fix amqp

* some amqp tests

* move OpenTelemetryModule.php to container

* revert AsynchronousRunningEndpoint

* run cs fixer

* cleaning

* cleaning

* cleaning

* cleaning

* quick laravel implementation (eager loading)

* fix amqp tests

* PASSING TESTS ?

* remove benchmark

* laravel with cache

* fix phpstan

* resolve logger...

* fix wrong type

* cleaning

* move tests

* fix opentelemetry api

* fix opentelemetry version

* fix php di implementation

* fix sf test

* wording amqp

* remove sf wache warming test (undeterministic)

* fix php di external container precedence

* fix php di external container precedence

* cleaning

* lazy container for lite

* add symfony console command registration

* cleaning

* warmup proxies only when cache is enabled

* restrict symfony for named arguments bugfix

see: symfony/symfony#49077

* run benchmarks with opcache enabled

* review

* clean

* clean ChainMessageHandlerBuilder.php

* remove unused interface

* drop ReferenceConverter.php

* clean

* clean

* remove CONSUMER_POLLING_METADATA from framework headers

* clean

* cleaning CallAggregateServiceBuilder.php

* cleaning

* clean LoadAggregateServiceBuilder.php

* clean SaveAggregateServiceBuilder.php

* clean

* refactor and fixes

* Ecotone Lite in production mode

* Refactor proxy factory to align with master branch

* Remove boot and terminate methods from Messaging

* clean up

* avoid magic numbers

* Change name of AroundInterceptorReference to AroundInterceptorBuilder

* add todo

* Refactor naming

* Fix symfony container

* Combine constructor and factory method arguments

* fix cleaning cache

* More reliable tests

* todos before merge

* todo and remove dead code

* clean up

* remove dead code

* clear cache for each test case

* remove hard coded references

* remove hard coded strings in GatewayProxyBuilder.php

* remove passing array in Container register function as it make the signature too complex

* hash php-di container class name

So multiple containers can be loaded in the same php process (for testing for isntance)

* clean visibility

* improve lite caching

* add failing test

* serialize complex attributes for symfony and php-di container implementations

* skip complex attribute test for php < 8.1

* throw an exception when a not dumpable instance is found in the messaging configuration graph

* Verify polling metadata is not propagated

---------

Co-authored-by: jlabedo <jean@needelp.com>
Co-authored-by: Dariusz Gafka <dgafka.mail@gmail.com>
Co-authored-by: Dariusz Gafka <dariuszgafka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants