Completed
Pull Request — master (#3666)
by
unknown
62:16
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
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