@@ -132,6 +132,7 @@ private function getSourceData(array $config, string $origin): array
132132 {
133133 $ result = [];
134134 foreach ($ config as $ patchId => $ patchGeneralConfig ) {
135+ $ replacedPatchReleases = [];
135136 $ data = ['id ' => $ patchId ];
136137 $ data += $ this ->getPatchConstraintsData ($ patchGeneralConfig ['packages ' ]);
137138
@@ -145,11 +146,18 @@ private function getSourceData(array $config, string $origin): array
145146
146147 $ replacedWith = [];
147148 foreach ($ data ['replacedWith ' ] ?? [] as $ replacedPatchId => $ replacedPatchConstraints ) {
149+ $ replacedPatchReleases = array_unique (array_merge (
150+ $ replacedPatchReleases ?? [],
151+ $ this ->getCompatibleReleases ($ replacedPatchConstraints )
152+ ));
148153 $ replacedWith [] = $ replacedPatchId . ' for ' .
149154 implode (', ' , $ this ->getCompatibleReleases ($ replacedPatchConstraints ));
150155 }
151156 if (!empty ($ replacedWith )) {
152- $ data ['replacedWith ' ] = implode ('; ' , $ replacedWith );
157+ $ currentPatchReleases = array_diff ($ data ['releases ' ], $ replacedPatchReleases );
158+ $ data ['replacedWith ' ] = $ currentPatchReleases ?
159+ $ patchId . ' for ' . implode (', ' , $ currentPatchReleases ) . '. Use ' : '' ;
160+ $ data ['replacedWith ' ] .= implode ('; ' , $ replacedWith );
153161 }
154162
155163 $ data ['description ' ] = $ patchGeneralConfig ['title ' ];
0 commit comments