diff --git a/LibHooks/lib/PreCommit/Filter/ShortCommitMsg.php b/LibHooks/lib/PreCommit/Filter/ShortCommitMsg.php index d7d33b2..0626029 100644 --- a/LibHooks/lib/PreCommit/Filter/ShortCommitMsg.php +++ b/LibHooks/lib/PreCommit/Filter/ShortCommitMsg.php @@ -64,7 +64,10 @@ protected function _getFormatterConfig() */ protected function _getParser() { - return new ShortCommitMsg\Jira\Parser(); + $class = $this->_getConfig()->getNode( + 'tracker/' . $this->_getTrackerType() . '/message/parser/class' + ); + return new $class; } /** @@ -98,4 +101,14 @@ protected function _getConfig() { return Config::getInstance(); } + + /** + * Get tracker type + * + * @return string + */ + protected function _getTrackerType() + { + return (string)$this->_getConfig()->getNode('tracker/type'); + } }