@@ -82,7 +82,9 @@ protected function generateValidators(PropertyInterface $property, array $proper
8282 // NotProcessor) the value must be proposed before the validation
8383 'postPropose ' => $ this instanceof ComposedPropertiesInterface,
8484 'mergedProperty ' =>
85- $ createMergedProperty ? $ this ->createMergedProperty ($ property , $ properties ) : null ,
85+ $ createMergedProperty
86+ ? $ this ->createMergedProperty ($ property , $ properties , $ propertyData )
87+ : null ,
8688 'onlyForDefinedValues ' =>
8789 $ propertyData ['onlyForDefinedValues ' ] && $ this instanceof ComposedPropertiesInterface,
8890 ]
@@ -98,13 +100,21 @@ protected function generateValidators(PropertyInterface $property, array $proper
98100 *
99101 * @param PropertyInterface $compositionProperty
100102 * @param CompositionPropertyDecorator[] $properties
103+ * @param array $propertyData
101104 *
102105 * @return PropertyInterface
103106 */
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 {
106112 $ 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+
108118 $ mergedProperty = new Property ('MergedProperty ' , $ mergedClassName );
109119
110120 foreach ($ properties as $ property ) {
0 commit comments