Failed Conditions
Pull Request — develop (#3348)
by Sergei
62:13
created

ShardingException::noShardDistributionValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Doctrine\DBAL\Sharding;
4
5
use Doctrine\DBAL\DBALException;
6
7
/**
8
 * Sharding related Exceptions
9
 */
10
class ShardingException extends DBALException
11
{
12
    public static function notImplemented() : self
13
    {
14
        return new self('This functionality is not implemented with this sharding provider.', 1331557937);
15
    }
16
17
    public static function missingDefaultFederationName() : self
18
    {
19
        return new self('SQLAzure requires a federation name to be set during sharding configuration.', 1332141280);
20
    }
21
22
    public static function missingDefaultDistributionKey() : self
23 19
    {
24
        return new self('SQLAzure requires a distribution key to be set during sharding configuration.', 1332141329);
25 19
    }
26
27
    public static function activeTransaction() : self
28
    {
29
        return new self('Cannot switch shard during an active transaction.', 1332141766);
30
    }
31 19
32
    public static function missingDistributionType() : self
33 19
    {
34
        return new self("You have to specify a sharding distribution type such as 'integer', 'string', 'guid'.");
35
    }
36
}
37