Skip to content

[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

Merged
merged 1 commit into from
Aug 26, 2014

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Aug 21, 2014

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

ping @webmozart

@lyrixx lyrixx force-pushed the property-path-expose-config branch 2 times, most recently from 91436ce to 2ee360b Compare August 22, 2014 08:38
@webmozart
Copy link
Contributor

Great!

👍

@xabbuh
Copy link
Member

xabbuh commented Aug 22, 2014

You need to update the XML schema definition too.

@lyrixx lyrixx force-pushed the property-path-expose-config branch from 2ee360b to eac64c3 Compare August 22, 2014 09:11
@lyrixx
Copy link
Member Author

lyrixx commented Aug 22, 2014

@xabbuh Thanks. I update the XML schema. Can you double check, I never did that before...

@stof
Copy link
Member

stof commented Aug 22, 2014

you are missing the usage of the type to define the element using it in the config type:

<xsd:element name="property-accessor" type="property_accessor" minOccurs="0" maxOccurs="1" />

@@ -177,4 +177,9 @@
<xsd:attribute name="debug" type="xsd:string" />
<xsd:attribute name="file-cache-dir" type="xsd:string" />
</xsd:complexType>

<xsd:complexType name="property_access">
<xsd:attribute name="magic_call" type="xsd:boolean" />
Copy link
Member

Choose a reason for hiding this comment

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

attribute names should use dashes, not underscores

@lyrixx lyrixx force-pushed the property-path-expose-config branch from eac64c3 to 5bedf13 Compare August 22, 2014 10:07
@lyrixx
Copy link
Member Author

lyrixx commented Aug 22, 2014

@stof Done. But other block misses minOccurs and co ...

@stof
Copy link
Member

stof commented Aug 22, 2014

@lyrixx nope. The issue is that what you did is not what I asked for. the definition of the property_accessor complexType was right before. what was missing was the usage of this complexType to say that the config type (defined at the beginning of the XSD) can have a property-accessor child appearing 0 or 1 times and using this property_accessor type.

your current XSD is allowing to put property-accessor as a top-level element in the config, not as a child of <config>, which is wrong.

@lyrixx lyrixx force-pushed the property-path-expose-config branch from 5bedf13 to 2366217 Compare August 22, 2014 11:38
@lyrixx
Copy link
Member Author

lyrixx commented Aug 22, 2014

@stof Thanks. It should be ok now. I just rename property_accessor to property_access. Is it ok now ?

@stof
Copy link
Member

stof commented Aug 22, 2014

👍

->getDefinition('property_accessor')
->replaceArgument(0, $config['magic_call'])
->replaceArgument(1, $config['throw_exception_on_invalid_index'])
;
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 please add a test for this functionality to FrameworkExtensionTest?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@lyrixx lyrixx force-pushed the property-path-expose-config branch from 2366217 to 75afdef Compare August 22, 2014 12:27
@nicolas-grekas
Copy link
Member

👍

->addDefaultsIfNotSet()
->info('Property access configuration')
->children()
->booleanNode('magic_call')->defaultFalse()->end()
Copy link
Member

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?

Copy link
Member Author

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.

@fabpot
Copy link
Member

fabpot commented Aug 26, 2014

Thank you @lyrixx.

@fabpot fabpot merged commit 75afdef into symfony:master Aug 26, 2014
fabpot added a commit that referenced this pull request Aug 26, 2014
…ss (lyrixx)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Expose configuration of PropertyAccess

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

ping @webmozart

Commits
-------

75afdef [FrameworkBundle] Expose configuration of PropertyAccess
@lyrixx lyrixx deleted the property-path-expose-config branch August 26, 2014 13:12
weaverryan added a commit to symfony/symfony-docs that referenced this pull request Dec 7, 2014
…ments (xabbuh)

This PR was merged into the 2.6 branch.

Discussion
----------

[Reference] document configurable PropertyAccessor arguments

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes (symfony/symfony#11731)
| Applies to    | 2.6+
| Fixed tickets | #4192

Commits
-------

828ba4d document configurable PropertyAccessor arguments
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.

7 participants