Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Symfony\Component\Form\Util\Pr opertyPath::writeProperty method exception behaviour
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robert Leverington  
View profile  
 More options Oct 5 2012, 7:23 am
From: Robert Leverington <robert.levering...@strategyeye.com>
Date: Fri, 5 Oct 2012 04:23:40 -0700 (PDT)
Local: Fri, Oct 5 2012 7:23 am
Subject: Symfony\Component\Form\Util\PropertyPath ::writeProperty method exception behaviour
Currently the "Symfony\Component\Form\Util
\PropertyPath::writeProperty" method performs a series of checks to
determine which way to set the property on the active object. In
particular, it checks whether a "setPropertyName()" method exists and
if it does then it checks to see if that is a public method. This
takes place before trying other methods such as a magic "__set()"
method or a public property of that name on the object.

Unfortunately this means if your object only exposes the magic
"__set()" method, but uses the "setPropertyName()" methods internally
as protected member methods the "writeProperty()" method will detect
that it can't access the "setPropertyName()" method first and throw an
exception.

In my opinion, this is not necessarily correct. While it is certainly
useful in some cases to detect a potential mistake, an external class
should not stop working due to the internal behaviour of an object.

I'd like to propose that the checks to detect whether the method is
public be moved in to their parent if statements, and the exception
removed. A message suggesting that developers check whether the
property or setter are public could be added to the final
"InvalidPropertyException". Is there another compelling reason to keep
these exceptions that I have missed?

Thanks,

Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernhard Schussek  
View profile  
 More options Oct 18 2012, 11:15 am
From: Bernhard Schussek <bschus...@gmail.com>
Date: Thu, 18 Oct 2012 17:14:25 +0200
Local: Thurs, Oct 18 2012 11:14 am
Subject: Re: [symfony-devs] Symfony\Component\Form\Util\PropertyPath ::writeProperty method exception behaviour
Hi Robert,

Your arguments make sense. Could you please open a ticket?

Thanks,
Bernhard


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Leverington  
View profile  
 More options Oct 18 2012, 11:33 am
From: Robert Leverington <robert.levering...@strategyeye.com>
Date: Thu, 18 Oct 2012 16:33:06 +0100
Local: Thurs, Oct 18 2012 11:33 am
Subject: Re: [symfony-devs] Symfony\Component\Form\Util\PropertyPath ::writeProperty method exception behaviour

Thank you for your response. I've opened this as issue 5775.

https://github.com/symfony/symfony/issues/5775

Thanks,

Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »