Failed Conditions
Pull Request — master (#3666)
by
unknown
04:25
created

Oracle122Platform::getMaxIdentifierLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 1
c 2
b 1
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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
class Oracle122Platform extends OraclePlatform
12
{
13
    /**
14
     * {@inheritDoc}
15
     * 
16
     * @param string $schemaElementName
17
     * 
18
     * @return string
19
     */
20
    public function fixSchemaElementName($schemaElementName)
21
    {
22
        if (strlen($schemaElementName) > 128) {
23
            // Trim it
24
            return substr($schemaElementName, 0, 128);
25
        }
26
27
        return $schemaElementName;
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     * 
33
     * @return int
34
     */
35
    public function getMaxIdentifierLength()
36
    {
37
        return 128;
38
    }
39
}
40