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

Oracle122Platform::fixSchemaElementName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 8
rs 10
cc 2
nc 2
nop 1
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
}