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

ORMException::invalidMagicCall()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 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