File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
src/Symfony/Component/PropertyInfo Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ public function getProperties($class, array $context = [])
103103 if (!$ propertyName || isset ($ properties [$ propertyName ])) {
104104 continue ;
105105 }
106- if (!$ reflectionClass ->hasProperty ($ propertyName ) && !preg_match ('/^[A-Z]{2,}/ ' , $ propertyName )) {
107- $ propertyName = lcfirst ( $ propertyName ) ;
106+ if ($ reflectionClass -> hasProperty ( $ lowerCasedPropertyName = lcfirst ( $ propertyName )) || ( !$ reflectionClass ->hasProperty ($ propertyName ) && !preg_match ('/^[A-Z]{2,}/ ' , $ propertyName) )) {
107+ $ propertyName = $ lowerCasedPropertyName ;
108108 }
109109 $ properties [$ propertyName ] = $ propertyName ;
110110 }
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ public function testGetProperties()
5959 '123 ' ,
6060 'self ' ,
6161 'realParent ' ,
62+ 'xTotals ' ,
63+ 'YT ' ,
6264 'c ' ,
6365 'd ' ,
6466 'e ' ,
Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ class Dummy extends ParentDummy
9393 */
9494 public $ j ;
9595
96+ /**
97+ * @var array
98+ */
99+ private $ xTotals ;
100+
101+ /**
102+ * @var string
103+ */
104+ private $ YT ;
105+
96106 /**
97107 * This should not be removed.
98108 *
@@ -166,4 +176,18 @@ public function setSelf(self $self)
166176 public function setRealParent (parent $ realParent )
167177 {
168178 }
179+
180+ /**
181+ * @return array
182+ */
183+ public function getXTotals ()
184+ {
185+ }
186+
187+ /**
188+ * @return string
189+ */
190+ public function getYT ()
191+ {
192+ }
169193}
You can’t perform that action at this time.
0 commit comments