-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[FrameworkBundle] Expose configuration of PropertyAccess #11731
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,8 @@ public function load(array $configs, ContainerBuilder $container) | |
|
||
$this->registerAnnotationsConfiguration($config['annotations'], $container, $loader); | ||
|
||
$this->registerPropertyAccessConfiguration($config['property_access'], $container); | ||
|
||
if (isset($config['serializer']) && $config['serializer']['enabled']) { | ||
$loader->load('serializer.xml'); | ||
} | ||
|
@@ -818,6 +820,15 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde | |
} | ||
} | ||
|
||
private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container) | ||
{ | ||
$container | ||
->getDefinition('property_accessor') | ||
->replaceArgument(0, $config['magic_call']) | ||
->replaceArgument(1, $config['throw_exception_on_invalid_index']) | ||
; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add a test for this functionality to FrameworkExtensionTest? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
} | ||
|
||
/** | ||
* Loads the security configuration. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
$container->loadFromExtension('framework', array( | ||
'property_access' => array( | ||
'magic_call' => true, | ||
'throw_exception_on_invalid_index' => true, | ||
), | ||
)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
||
<framework:config> | ||
<framework:property-access magic-call="true" throw-exception-on-invalid-index="true" /> | ||
</framework:config> | ||
</container> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
framework: | ||
property_access: | ||
magic_call: true | ||
throw_exception_on_invalid_index: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these
booleanNode
children also include some->info()
methods to explain their purpose?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, it's a direct mapping to the class argument. So it's already documented. Then I think very few people will change values here.