Test Failed
Pull Request — develop (#6743)
by Grégoire
64:39
created

ORMException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
ccs 0
cts 3
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A unexpectedAssociationValue() 0 4 1
A notSupported() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM;
6
7
use Doctrine\Common\Cache\Cache as CacheDriver;
8
use Exception;
9
10
/**
11
 * Base exception class for all ORM exceptions.
12
 *
13
 * @author Roman Borschel <[email protected]>
14
 * @since 2.0
15
 */
16
class ORMException extends Exception
17
{
18
    /**
19
     *
20
     * @param string $class
21
     * @param string $association
22
     * @param string $given
23
     * @param string $expected
24
     *
25
     * @return \Doctrine\ORM\ORMInvalidArgumentException
26
     */
27
    public static function unexpectedAssociationValue($class, $association, $given, $expected)
28
    {
29
        return new self(sprintf('Found entity of type %s on association %s#%s, but expecting %s', $given, $class, $association, $expected));
30
    }
31
32
    /**
33
     * @return ORMException
34
     */
35
    public static function notSupported()
36
    {
37
        return new self("This behaviour is (currently) not supported by Doctrine 2");
38
    }
39
}
40