@@ -259,6 +259,20 @@ class Configuration
259259 */
260260 protected $ postRun ;
261261
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+
262276 /**
263277 * Constructor.
264278 */
@@ -307,6 +321,8 @@ public function fromArray(array $array)
307321 'releaseCommitMessageFormat ' => $ this ->getReleaseCommitMessageFormat (),
308322 'preRun ' => $ this ->getPreRun (),
309323 'postRun ' => $ this ->getPostRun (),
324+ 'postProcessRegex ' => $ this ->getPostProcessRegex (),
325+ 'postProcessReplace ' => $ this ->getPostProcessReplace (),
310326 ];
311327
312328 $ params = array_replace_recursive ($ defaults , $ array );
@@ -372,7 +388,10 @@ public function fromArray(array $array)
372388 ->setReleaseCommitMessageFormat ($ params ['releaseCommitMessageFormat ' ])
373389 // Hooks
374390 ->setPreRun ($ params ['preRun ' ])
375- ->setPostRun ($ params ['postRun ' ]);
391+ ->setPostRun ($ params ['postRun ' ])
392+ // Text PostProcessing
393+ ->setPostProcessRegex ($ params ['postProcessRegex ' ])
394+ ->setPostProcessReplace ($ params ['postProcessReplace ' ]);
376395 }
377396
378397 /**
@@ -825,6 +844,41 @@ public function setPostRun($postRun): self
825844 return $ this ;
826845 }
827846
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+
828882 public function isPackageBump (): bool
829883 {
830884 return $ this ->packageBump ;
0 commit comments