PgsqlDatabaseTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 3
b 0
f 0
dl 0
loc 12
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A escapeIdentifier() 0 3 1
A escapeTableName() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Traits;
6
7
trait PgsqlDatabaseTrait
8
{
9
    public function escapeIdentifier(string $string): string
10
    {
11
        return '"' . \str_replace('"', '""', $string) . '"';
12
    }
13
14
    public function escapeTableName(string $string): string
15
    {
16
        // @TODO Fix.
17
        throw new \WebServCo\Framework\Exceptions\NotImplementedException(
18
            \sprintf('Method not implemented. String: %s.', $string),
19
        );
20
    }
21
}
22