Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Remove internals from autowiring #530

Merged

Conversation

Simperfit
Copy link
Contributor

@Simperfit Simperfit commented Nov 18, 2017

The bug does not seems to be in 3.0.

#SymfonyConHackday2017

@@ -103,10 +103,10 @@ public function load(array $configs, ContainerBuilder $container)
if (class_exists(SecurityExpressionLanguage::class)) {
$container->setAlias('sensio_framework_extra.security.expression_language', new Alias($config['security']['expression_language'], false));
} else {
$container->removeDefinition('Sensio\Bundle\FrameworkExtraBundle\Security\ExpressionLanguage');
$container->removeDefinition('framework_extra_bundle.expression_language');
Copy link
Collaborator

Choose a reason for hiding this comment

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

the configuration prefix is "sensio_framework_extra", should use the same?

@Simperfit
Copy link
Contributor Author

Simperfit commented Nov 19, 2017 via email

nicolas-grekas added a commit to symfony/symfony that referenced this pull request Nov 19, 2017
This PR was merged into the 4.0-dev branch.

Discussion
----------

[HttpKernel] add type-hint for the requestType

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | see sensiolabs/SensioFrameworkExtraBundle#530
| License       | MIT

#SymfonyConHackday2017

Commits
-------

62d933d [HttpKernel] add type-hint for the requestType
@Simperfit Simperfit force-pushed the feature/remove-autowired-internals branch from d753cee to daffc9c Compare November 20, 2017 08:42
@nicolas-grekas
Copy link
Collaborator

I just found #488, which this PR basically reverts. We should revert to the same names that we used before, don't you think?

@Simperfit
Copy link
Contributor Author

Yeah I agree, I'm going to do that

@Simperfit Simperfit force-pushed the feature/remove-autowired-internals branch from daffc9c to 4e0b3ae Compare November 21, 2017 05:10
Copy link
Contributor

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

This is a BC break of course, but none of these services were meant to be used for autowiring.

So 👍

@stof
Copy link
Contributor

stof commented Nov 29, 2017

Reusing the old name has an advantage: it will avoid breaking bundles needing to deal with these services, if they kept support for the previous version of the bundle (I'm looking at FOSRestBundle here).

@fabpot
Copy link
Member

fabpot commented Nov 29, 2017

Thank you @Simperfit.

@fabpot fabpot merged commit 4e0b3ae into sensiolabs:master Nov 29, 2017
fabpot added a commit that referenced this pull request Nov 29, 2017
This PR was merged into the 5.1.x-dev branch.

Discussion
----------

Remove internals from autowiring

The bug does not seems to be in 3.0.

#SymfonyConHackday2017

Commits
-------

4e0b3ae Remove internals from autowiring
<tag name="request.param_converter" converter="datetime" />
</service>

<service id="Symfony\Component\ExpressionLanguage\ExpressionLanguage" class="Symfony\Component\ExpressionLanguage\ExpressionLanguage" public="false" />
<service id="framework_extra_bundle.expression_language" class="Symfony\Component\ExpressionLanguage\ExpressionLanguage" public="false" />
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be sensio_framework_extra.converter.doctrine.orm.expression_language to match what is used in the framework_extra_bundle.doctrine_param_converter service ?

<argument type="service" id="sensio_framework_extra.security.expression_language" on-invalid="null" />
<service id="sensio_framework_extra.security.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener" public="false">
<argument type="service" id="framework_extra_bundle.argument_name_convertor" />
<argument type="service" id="sensio_framework_extra.security.expression_language.default" on-invalid="null" />
Copy link
Contributor

Choose a reason for hiding this comment

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

that's wrong. It must used the configured service (which will be an alias)


<service id="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter" public="false">
<service id="framework_extra_bundle.doctrine_param_converter" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter" public="false">
Copy link
Contributor

Choose a reason for hiding this comment

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

Lots of services are missing the sensio_ part in the prefix, so they don't respect the best practices, and are not reverted to the old names

@stof
Copy link
Contributor

stof commented Nov 30, 2017

@fabpot this PR contains a bunch of mistakes when reverting to old ids. It would be great to fix them

@Simperfit
Copy link
Contributor Author

Simperfit commented Nov 30, 2017 via email

@weaverryan
Copy link
Contributor

Yea, I approved too quickly - I thought it was a clean revert of the earlier PR :/

weaverryan added a commit to weaverryan/SensioFrameworkExtraBundle that referenced this pull request Nov 30, 2017
@weaverryan
Copy link
Contributor

Fixed in #534

fabpot added a commit that referenced this pull request Nov 30, 2017
…rryan)

This PR was merged into the 5.1.x-dev branch.

Discussion
----------

Fixing #530 by manually looking at #488 and reverting

Hi guys!

#530 was basically meant to revert #488, but it was not done perfectly. I approved it too quickly - my apologies for that. This fixes #532

I looked at each line in #488 and manually (and carefully) changed the code to use the old service id's everywhere. I believe this should fix the issues!

Cheers!

Commits
-------

cb0851b Fixing #530 by manually looking at #488 and reverting
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants