Completed
Pull Request — master (#3666)
by
unknown
64:17
created

Oracle122Platform   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMaxIdentifierLength() 0 3 1
A fixSchemaElementName() 0 8 2
1
<?php
2
3
namespace Doctrine\DBAL\Platforms;
4
5
use function strlen;
6
use function substr;
7
8
/**
9
 * Provides behaviour name longer than 32 chars since Oracle 12.2
10
 *
11
 */
12
class Oracle122Platform extends OraclePlatform
13
{
14
    /**
15
     * {@inheritDoc}
16
     */
17
    public function fixSchemaElementName($schemaElementName)
18
    {
19
        if (strlen($schemaElementName) > 128) {
20
            // Trim it
21
            return substr($schemaElementName, 0, 128);
22
        }
23
24
        return $schemaElementName;
25
    }
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function getMaxIdentifierLength()
31
    {
32
        return 128;
33
    }
34
}