Passed
Push — master ( f5da16...2e3bf1 )
by Jean-Christophe
12:28
created

AbstractDriverMetaDatas::getPHPType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 2
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Ubiquity\db\providers\pdo\drivers;
4
5
/**
6
 * Ubiquity\db\providers$DriverMetaDatas
7
 * This class is part of Ubiquity
8
 *
9
 * @author jc
10
 * @version 1.0.1
11
 *
12
 */
13
abstract class AbstractDriverMetaDatas {
14
	protected $dbInstance;
15
16 32
	public function __construct($dbInstance) {
17 32
		$this->dbInstance = $dbInstance;
18 32
	}
19
20
	/**
21
	 * Returns all table names in the database.
22
	 *
23
	 * @return array
24
	 */
25
	abstract public function getTablesName(): array;
26
27
	/**
28
	 * Returns an array of the primary keys field names.
29
	 *
30
	 * @param string $tableName
31
	 * @return array
32
	 */
33
	abstract public function getPrimaryKeys(string $tableName): array;
34
35
	/**
36
	 * Returns the list of foreign keys in a table.
37
	 *
38
	 * @param string $tableName
39
	 * @param string $pkName
40
	 * @param string $dbName
41
	 * @return array
42
	 */
43
	abstract public function getForeignKeys(string $tableName, string $pkName, ?string $dbName = null): array;
44
45
	/**
46
	 * Returns metadata related to the fields of the specified table.
47
	 *
48
	 * @param string $tableName
49
	 * @return array
50
	 */
51
	abstract public function getFieldsInfos(string $tableName): array;
52
53
	/**
54
	 * Returns the line number of a data record.
55
	 *
56
	 * @param string $tableName
57
	 * @param string $pkName
58
	 * @param string $condition
59
	 * @return int
60
	 */
61
	abstract public function getRowNum(string $tableName, string $pkName, string $condition): int;
62
63
	/**
64
	 * Returns the SQL callback for fields concatenation
65
	 *
66
	 * @param string $fields
67
	 * @return string
68
	 */
69
	abstract public function groupConcat(string $fields, string $separator): string;
70
71 25
	public function toStringOperator() {
72 25
		return '';
73
	}
74
75
	public function getPHPType(string $dbType): string {
1 ignored issue
show
Unused Code introduced by
The parameter $dbType is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

75
	public function getPHPType(/** @scrutinizer ignore-unused */ string $dbType): string {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
76
		return '';
77
	}
78
}
79
80