@@ -82,7 +82,9 @@ protected function generateValidators(PropertyInterface $property, array $proper
82
82
// NotProcessor) the value must be proposed before the validation
83
83
'postPropose ' => $ this instanceof ComposedPropertiesInterface,
84
84
'mergedProperty ' =>
85
- $ createMergedProperty ? $ this ->createMergedProperty ($ property , $ properties ) : null ,
85
+ $ createMergedProperty
86
+ ? $ this ->createMergedProperty ($ property , $ properties , $ propertyData )
87
+ : null ,
86
88
'onlyForDefinedValues ' =>
87
89
$ propertyData ['onlyForDefinedValues ' ] && $ this instanceof ComposedPropertiesInterface,
88
90
]
@@ -98,13 +100,21 @@ protected function generateValidators(PropertyInterface $property, array $proper
98
100
*
99
101
* @param PropertyInterface $compositionProperty
100
102
* @param CompositionPropertyDecorator[] $properties
103
+ * @param array $propertyData
101
104
*
102
105
* @return PropertyInterface
103
106
*/
104
- private function createMergedProperty (PropertyInterface $ compositionProperty , array $ properties ): PropertyInterface
105
- {
107
+ private function createMergedProperty (
108
+ PropertyInterface $ compositionProperty ,
109
+ array $ properties ,
110
+ array $ propertyData
111
+ ): PropertyInterface {
106
112
$ mergedPropertySchema = new Schema ();
107
- $ mergedClassName = sprintf ('%s_Merged_%s ' , $ this ->schemaProcessor ->getCurrentClassName (), uniqid ());
113
+ $ mergedClassName = sprintf (
114
+ '%s_Merged_%s ' , $ this ->schemaProcessor ->getCurrentClassName (),
115
+ $ propertyData ['propertyData ' ]['id ' ] ?? uniqid ()
116
+ );
117
+
108
118
$ mergedProperty = new Property ('MergedProperty ' , $ mergedClassName );
109
119
110
120
foreach ($ properties as $ property ) {
0 commit comments