Failed Conditions
Push — master ( a2f8a2...e02dc1 )
by Alexander
01:53
created

AbstractDataCollector::getBackwardsCompatibilityBreaks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the Code-Insight 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/code-insight
9
 */
10
11
namespace ConsoleHelpers\CodeInsight\KnowledgeBase\DataCollector;
12
13
14
use Aura\Sql\ExtendedPdoInterface;
15
use ConsoleHelpers\CodeInsight\KnowledgeBase\KnowledgeBase;
16
use Go\ParserReflection\ReflectionFileNamespace;
17
18
abstract class AbstractDataCollector
19
{
20
21
	/**
22
	 * Database.
23
	 *
24
	 * @var ExtendedPdoInterface
25
	 */
26
	protected $db;
1 ignored issue
show
Comprehensibility introduced by
Avoid variables with short names like $db. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
27
28
	/**
29
	 * Creates data collector instance.
30
	 *
31
	 * @param ExtendedPdoInterface $db Database.
32
	 */
33 22
	public function __construct(ExtendedPdoInterface $db)
1 ignored issue
show
Comprehensibility introduced by
Avoid variables with short names like $db. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
34
	{
35 22
		$this->db = $db;
36 22
	}
37
38
	/**
39
	 * Collect data from a namespace.
40
	 *
41
	 * @param integer                 $file_id   File id.
42
	 * @param ReflectionFileNamespace $namespace Namespace.
43
	 *
44
	 * @return void
45
	 */
46
	abstract public function collectData($file_id, ReflectionFileNamespace $namespace);
47
48
	/**
49
	 * Aggregate previously collected data.
50
	 *
51
	 * @param KnowledgeBase $knowledge_base Knowledge base.
52
	 *
53
	 * @return void
54
	 */
55 4
	public function aggregateData(KnowledgeBase $knowledge_base)
56
	{
57
58 4
	}
59
60
	/**
61
	 * Delete previously collected data for a files.
62
	 *
63
	 * @param array $file_ids File IDs.
64
	 *
65
	 * @return void
66
	 */
67
	abstract public function deleteData(array $file_ids);
68
69
	/**
70
	 * Returns statistics about the code.
71
	 *
72
	 * @return array
73
	 */
74
	public function getStatistics()
75
	{
76
		return array();
77
	}
78
79
}
80