LogMessageParserFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLogMessageParser() 0 7 2
1
<?php
2
/**
3
 * This file is part of the SVN-Buddy library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/console-helpers/svn-buddy
9
 */
10
11
namespace ConsoleHelpers\SVNBuddy\Repository\Parser;
12
13
14
class LogMessageParserFactory
15
{
16
17
	/**
18
	 * Log message parsers.
19
	 *
20
	 * @var LogMessageParser[]
21
	 */
22
	private $_parsers = array();
23
24
	/**
25
	 * Returns log message parser.
26
	 *
27
	 * @param string $bugtraq_logregex Regular expression(-s) for bug id finding in log message.
28
	 *
29
	 * @return LogMessageParser
30
	 */
31 3
	public function getLogMessageParser($bugtraq_logregex)
32
	{
33 3
		if ( !isset($this->_parsers[$bugtraq_logregex]) ) {
34 3
			$this->_parsers[$bugtraq_logregex] = new LogMessageParser($bugtraq_logregex);
35
		}
36
37 3
		return $this->_parsers[$bugtraq_logregex];
38
	}
39
40
}
41