@@ -259,6 +259,20 @@ class Configuration
259
259
*/
260
260
protected $ postRun ;
261
261
262
+ /**
263
+ * A Regex string to be used on the commit text post processing.
264
+ *
265
+ * @var string
266
+ */
267
+ protected $ postProcessRegex = '' ;
268
+
269
+ /**
270
+ * A Regex replace string to be used on the commit text post processing.
271
+ *
272
+ * @var string
273
+ */
274
+ protected $ postProcessReplace = '' ;
275
+
262
276
/**
263
277
* Constructor.
264
278
*/
@@ -307,6 +321,8 @@ public function fromArray(array $array)
307
321
'releaseCommitMessageFormat ' => $ this ->getReleaseCommitMessageFormat (),
308
322
'preRun ' => $ this ->getPreRun (),
309
323
'postRun ' => $ this ->getPostRun (),
324
+ 'postProcessRegex ' => $ this ->getPostProcessRegex (),
325
+ 'postProcessReplace ' => $ this ->getPostProcessReplace (),
310
326
];
311
327
312
328
$ params = array_replace_recursive ($ defaults , $ array );
@@ -372,7 +388,10 @@ public function fromArray(array $array)
372
388
->setReleaseCommitMessageFormat ($ params ['releaseCommitMessageFormat ' ])
373
389
// Hooks
374
390
->setPreRun ($ params ['preRun ' ])
375
- ->setPostRun ($ params ['postRun ' ]);
391
+ ->setPostRun ($ params ['postRun ' ])
392
+ // Text PostProcessing
393
+ ->setPostProcessRegex ($ params ['postProcessRegex ' ])
394
+ ->setPostProcessReplace ($ params ['postProcessReplace ' ]);
376
395
}
377
396
378
397
/**
@@ -825,6 +844,41 @@ public function setPostRun($postRun): self
825
844
return $ this ;
826
845
}
827
846
847
+ public function getPostProcessRegex (): string
848
+ {
849
+ return $ this ->postProcessRegex ;
850
+ }
851
+
852
+ /**
853
+ * @param mixed $postProcessRegex
854
+ */
855
+ public function setPostProcessRegex ($ postProcessRegex ): self
856
+ {
857
+ $ this ->postProcessRegex = $ postProcessRegex ;
858
+
859
+ return $ this ;
860
+ }
861
+
862
+ public function getPostProcessReplace (): string
863
+ {
864
+ return $ this ->postProcessReplace ;
865
+ }
866
+
867
+ /**
868
+ * @param mixed $postProcessReplace
869
+ */
870
+ public function setPostProcessReplace ($ postProcessReplace ): self
871
+ {
872
+ $ this ->postProcessReplace = $ postProcessReplace ;
873
+
874
+ return $ this ;
875
+ }
876
+
877
+ public function hasPostProcessEnabled (): bool
878
+ {
879
+ return !empty ($ this ->getPostProcessRegex ()) && !empty ($ this ->getPostProcessReplace ());
880
+ }
881
+
828
882
public function isPackageBump (): bool
829
883
{
830
884
return $ this ->packageBump ;
0 commit comments