AbstractMergeSourceDetector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
c 0
b 0
f 0
dl 0
loc 37
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getWeight() 0 3 1
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\MergeSourceDetector;
12
13
14
abstract class AbstractMergeSourceDetector
15
{
16
17
	/**
18
	 * Weight.
19
	 *
20
	 * @var integer
21
	 */
22
	private $_weight;
23
24
	/**
25
	 * Creates detector.
26
	 *
27
	 * @param integer $weight Weight.
28
	 */
29 37
	public function __construct($weight)
30
	{
31 37
		$this->_weight = $weight;
32
	}
33
34
	/**
35
	 * Detects merge source from repository url.
36
	 *
37
	 * @param string $repository_url Repository url.
38
	 *
39
	 * @return null|string
40
	 */
41
	abstract public function detect($repository_url);
42
43
	/**
44
	 * Returns relative detector weight.
45
	 *
46
	 * @return integer
47
	 */
48 4
	public function getWeight()
49
	{
50 4
		return $this->_weight;
51
	}
52
53
}
54