Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

unexge
Copy link

@unexge unexge commented Sep 15, 2016

Q A
Branch? 2.8
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

port of #19684 for 2.8

$container = static::$kernel->getContainer();

$accessDecisionManager = $container->get('test.autowiring_types.autowired_services')->getAccessDecisionManager();
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\AccessDecisionManager', $accessDecisionManager);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a test-case where the debug variant is retrieved in debug/dev?

Copy link
Author

Choose a reason for hiding this comment

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

added, 2f6a92b.

$container = static::$kernel->getContainer();

$accessDecisionManager = $container->get('test.autowiring_types.autowired_services')->getAccessDecisionManager();
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\AccessDecisionManager', $accessDecisionManager);
Copy link
Contributor

Choose a reason for hiding this comment

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

When in debug, it should be an instance of Symfony\Component\Security\Core\Authorization\DebugAccessDecisionManager

Copy link
Author

Choose a reason for hiding this comment

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

yes, this case exist in #19684 (targeted 3.1).

see #19684 (comment),

DebugAccessDecisionManager has been introduced in 3.1

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I thought this was a feature, nevertheless, good to have this test so we will notice it breaks in 3.1 and it can be fixed there.

I think it's correct that autowiring are allowed in lower versions, but I'm not sure. Following semver it would not be allowed because if you rely on the functionality and you go back 1 patch due to a bug fix bug, you also break this "feature".

@dunglas
Copy link
Member

dunglas commented Sep 17, 2016

I agree with @iltar, I think it's a new feature and should not be backported to 2.8. It's not blocking anyway because the service can still be injected "manually", even with a definition having autowire set to true.

@fabpot
Copy link
Member

fabpot commented Sep 17, 2016

I think you're right. We've been to lax lately when merging such things in older branches.

@fabpot fabpot closed this Sep 17, 2016
@unexge unexge deleted the access_decision_manager_autowiring_2.8 branch September 17, 2016 21:31
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.

5 participants