Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DI] Add support for defining method calls in InlineServiceConfigurator#34916

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:masterfromLctrs:patch-1
Dec 13, 2019

Conversation

Lctrs
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Tickets
LicenseMIT
Doc PRN/A

rejinka reacted with thumbs up emoji
@@ -23,6 +23,7 @@ class InlineServiceConfigurator extends AbstractConfigurator
use Traits\ArgumentTrait;
use Traits\AutowireTrait;
use Traits\BindTrait;
use Traits\CallTrait;
Copy link
Member

@nicolas-grekasnicolas-grekasDec 10, 2019
edited
Loading

Choose a reason for hiding this comment

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

we could add also ConfiguratorTrait and PropertyTrait
but please confirm on a real app that this actually works before.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I tested it in a app powered by Symfony4.3 before landing this PR and it worked like a charm, even with nested inlines.

For reference, service is defined like this :

$services    ->set(EventStoreConnection::class)    ->factory([EventStoreConnectionFactory::class,'createFromConnectionString'])    ->args(['%env(resolve:EVENT_STORE_DSN)%',inline(ConnectionSettings::class)            ->factory([inline(ConnectionSettingsBuilder::class)                    ->call('useCustomLogger', [ref(LoggerInterface::class)]),'build'            ])    ]);

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

And I get this :

<?phpuseSymfony\Component\DependencyInjection\Argument\RewindableGenerator;useSymfony\Component\DependencyInjection\Exception\RuntimeException;// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.// Returns the public 'Prooph\EventStore\Async\EventStoreConnection' shared service.include_once$this->targetDirs[3].'/vendor/prooph/event-store-client/src/EventStoreConnectionFactory.php';include_once$this->targetDirs[3].'/vendor/prooph/event-store-client/src/ConnectionSettings.php';include_once$this->targetDirs[3].'/vendor/prooph/event-store-client/src/ConnectionSettingsBuilder.php';$a =new \Prooph\EventStoreClient\ConnectionSettingsBuilder();$a->useCustomLogger(($this->privates['logger'] ?? ($this->privates['logger'] =new \Symfony\Component\HttpKernel\Log\Logger())));return$this->services['Prooph\\EventStore\\Async\\EventStoreConnection'] = \Prooph\EventStoreClient\EventStoreConnectionFactory::createFromConnectionString($this->getEnv('resolve:EVENT_STORE_DSN'),$a->build());

Choose a reason for hiding this comment

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

ok, thanks, can you add ConfiguratorTrait and PropertyTrait please and validate they're ok too?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

They are ! PR updated.

@Lctrs
Copy link
ContributorAuthor

Test failure in theProcess component. Not related.

@nicolas-grekas
Copy link
Member

Can you please add a corresponding line in the CHANGELOG of the component?

@Lctrs
Copy link
ContributorAuthor

@nicolas-grekas Done. Is the wording okay for you ?

@nicolas-grekas
Copy link
Member

Thank you@Lctrs.

nicolas-grekas added a commit that referenced this pull requestDec 13, 2019
…rviceConfigurator (Lctrs)This PR was squashed before being merged into the 5.1-dev branch.Discussion----------[DI] Add support for defining method calls in InlineServiceConfigurator| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       || License       | MIT| Doc PR        | N/ACommits-------5af6e21 [DI] Add support for defining method calls in InlineServiceConfigurator
@nicolas-grekasnicolas-grekas merged commit5af6e21 intosymfony:masterDec 13, 2019
@LctrsLctrs deleted the patch-1 branchDecember 13, 2019 12:13
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

3 participants
@Lctrs@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp