Completed
Push — master ( d466fc...57558f )
by Pavel
03:56
created

MappingException::invalidClientName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Bankiru\Api\Doctrine\Exception;
4
5
use Doctrine\Common\Persistence\Mapping\MappingException as BaseMappingException;
6
7
class MappingException extends BaseMappingException implements DoctrineApiException
8
{
9
    public static function unknownAlias($alias)
10
    {
11
        return new self(sprintf('Unknown namespace alias "%s"', $alias));
12
    }
13
14
    public static function noSuchProperty($property, $class)
15
    {
16
        return new self(
17
            'Property "%s" not present within class %s',
18
            $property,
19
            $class
20
        );
21
    }
22
23
    public static function invalidClientName($class)
24
    {
25
        return new self(sprintf('Client name not specified for %s or any parent', $class));
26
    }
27
28
    public static function unknownField($field, $class)
29
    {
30
        return new self(sprintf('No mapping for field "%s" in %s', $field, $class));
31
    }
32
33
    public static function unknownAssociation($field, $class)
34
    {
35
        return new self(sprintf('No mapping for association "%s" in %s', $field, $class));
36
    }
37
38
    public static function invalidIdentifierStructure()
39
    {
40
        return new self('Identifier structure does not match mapping');
41
    }
42
43
    public static function noMethods()
44
    {
45
        return new self('No methods or entity-path configured');
46
    }
47
}
48