Completed
Push — master ( 56fa23...318c5e )
by Alexander
02:56
created

LogMessageParserFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLogMessageParser() 0 8 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 3
		}
36
37 3
		return $this->_parsers[$bugtraq_logregex];
38
	}
39
40
}
41