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 = [])
103
103
if (!$ propertyName || isset ($ properties [$ propertyName ])) {
104
104
continue ;
105
105
}
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 ;
108
108
}
109
109
$ properties [$ propertyName ] = $ propertyName ;
110
110
}
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ public function testGetProperties()
59
59
'123 ' ,
60
60
'self ' ,
61
61
'realParent ' ,
62
+ 'xTotals ' ,
63
+ 'YT ' ,
62
64
'c ' ,
63
65
'd ' ,
64
66
'e ' ,
Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ class Dummy extends ParentDummy
93
93
*/
94
94
public $ j ;
95
95
96
+ /**
97
+ * @var array
98
+ */
99
+ private $ xTotals ;
100
+
101
+ /**
102
+ * @var string
103
+ */
104
+ private $ YT ;
105
+
96
106
/**
97
107
* This should not be removed.
98
108
*
@@ -166,4 +176,18 @@ public function setSelf(self $self)
166
176
public function setRealParent (parent $ realParent )
167
177
{
168
178
}
179
+
180
+ /**
181
+ * @return array
182
+ */
183
+ public function getXTotals ()
184
+ {
185
+ }
186
+
187
+ /**
188
+ * @return string
189
+ */
190
+ public function getYT ()
191
+ {
192
+ }
169
193
}
You can’t perform that action at this time.
0 commit comments