Skip to content

Commit

Permalink
#13 Implement integration with GitHub
Browse files Browse the repository at this point in the history
 - Added getting class name of parser of short message..
  • Loading branch information
andkirby committed Dec 1, 2015
1 parent e4f0c77 commit 01fb5a5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion LibHooks/lib/PreCommit/Filter/ShortCommitMsg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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');
}
}

0 comments on commit 01fb5a5

Please sign in to comment.