File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -470,9 +470,17 @@ private function checkForDuplicate(MethodDescriptorInterface $descriptor): void
470470 $ this ->descriptorsByMethodName [$ name ] = [];
471471 }
472472 $ this ->descriptorsByMethodName [$ name ][] = $ descriptor ;
473- if (count ($ this ->descriptorsByMethodName [$ name ]) > 1 ) {
474- foreach ($ this ->descriptorsByMethodName [$ name ] as $ duplicateDescriptor ) {
475- $ duplicateDescriptor ->useAlternativeName ();
473+ $ descriptors = $ this ->descriptorsByMethodName [$ name ];
474+ if (count ($ descriptors ) > 1 ) {
475+ $ properties = array_filter ($ descriptors , function ($ descriptor ) {
476+ return $ descriptor instanceof AbstractBeanPropertyDescriptor;
477+ });
478+ $ renameProperties = count ($ properties ) > 1 ;
479+
480+ foreach ($ descriptors as $ descriptor ) {
481+ if ($ renameProperties || !$ descriptor instanceof AbstractBeanPropertyDescriptor) {
482+ $ descriptor ->useAlternativeName ();
483+ }
476484 }
477485 }
478486 }
You can’t perform that action at this time.
0 commit comments