Passed
Pull Request — master (#2893)
by Šimon
12:39
created

cleanSequenceNameFromSchemaName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Doctrine\DBAL\Platforms;
4
5
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
6
7
/**
8
 * Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform.
9
 *
10
 * @link   www.doctrine-project.org
11
 * @since  2.6
12
 */
13
class PostgreSQL100Platform extends PostgreSQL94Platform
14
{
15
	/**
16
	 * {@inheritdoc}
17
	 */
18 51
	protected function getReservedKeywordsClass() : string
19
	{
20 51
		return PostgreSQL100Keywords::class;
21
	}
22
23 1
	public function getSequenceMetadataSQL(string $rawSequenceName, string $schemaName) : string
24
	{
25 1
		$sequenceName = $this->cleanSequenceNameFromSchemaName($rawSequenceName, $schemaName);
26
27 1
		return 'SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = '.$this->quoteStringLiteral($schemaName).' AND sequencename = ' . $this->quoteStringLiteral($sequenceName);
28
	}
29
30 1
	private function cleanSequenceNameFromSchemaName(string $rawSequenceName, string $schemaName) : string
31
	{
32 1
		return str_replace($schemaName . '.', '', $rawSequenceName);
33
	}
34
}
35