Completed
Pull Request — master (#3666)
by
unknown
62:16
created

Oracle122Platform   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 3
Bugs 2 Features 1
Metric Value
wmc 3
eloc 4
c 3
b 2
f 1
dl 0
loc 27
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
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