bankiru /
doctrine-api-client
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 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 noClientSpecified($class) |
||
| 24 | { |
||
| 25 | return new self(sprintf('Client not specified for %s or any parent', $class)); |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function invalidClientSpecified($name, $message) |
||
| 29 | { |
||
| 30 | return new self(sprintf('Could not resolve client "%s": %s', $name, $message)); |
||
| 31 | } |
||
| 32 | |||
| 33 | public static function noApiSpecified($class) |
||
| 34 | { |
||
| 35 | return new self(sprintf('API factory not specified for %s or any parent', $class)); |
||
| 36 | } |
||
| 37 | |||
| 38 | public static function invalidApiSpecified($name, $message) |
||
| 39 | { |
||
| 40 | return new self(sprintf('Could not resolve API factory "%s": %s', $name, $message)); |
||
| 41 | } |
||
| 42 | |||
| 43 | public static function unknownField($field, $class) |
||
| 44 | { |
||
| 45 | return new self(sprintf('No mapping for field "%s" in %s', $field, $class)); |
||
| 46 | } |
||
| 47 | |||
| 48 | public static function unknownAssociation($field, $class) |
||
| 49 | { |
||
| 50 | return new self(sprintf('No mapping for association "%s" in %s', $field, $class)); |
||
| 51 | } |
||
| 52 | |||
| 53 | public static function invalidIdentifierStructure() |
||
| 54 | { |
||
| 55 | return new self('Identifier structure does not match mapping'); |
||
| 56 | } |
||
| 57 | |||
| 58 | public static function noMethods() |
||
| 59 | { |
||
| 60 | return new self('No methods or entity-path configured'); |
||
| 61 | } |
||
| 62 | |||
| 63 | public static function unknownApiFactory($alias) |
||
| 64 | { |
||
| 65 | return new static(sprintf('Unknown factory to create API: %s', $alias)); |
||
| 66 | } |
||
| 67 | |||
| 68 | public static function nameIsMandatoryForDiscriminatorColumns($alias) |
||
| 69 | { |
||
| 70 | return new static(sprintf('Name is mandatory for discriminator column: %s', $alias)); |
||
| 71 | } |
||
| 72 | |||
| 73 | public static function duplicateColumnName($alias, $column) |
||
| 74 | { |
||
| 75 | return new static(sprintf('Duplicate column name "%s": %s', $column, $alias)); |
||
| 76 | } |
||
| 77 | |||
| 78 | public static function invalidDiscriminatorColumnType($alias, $type) |
||
| 79 | { |
||
| 80 | return new static(sprintf('Invalud discriminator column type "%s": %s', $type, $alias)); |
||
| 81 | } |
||
| 82 | |||
| 83 | public static function mappedClassNotPartOfDiscriminatorMap($name, $rootEntityName) |
||
| 84 | { |
||
| 85 | return new static(sprintf('Mapped class "%s" is not a part of discriminator map: %s', $name, $rootEntityName)); |
||
| 86 | } |
||
| 87 | |||
| 88 | public static function unknownDiscriminatorValue($value, $alias) |
||
| 89 | { |
||
| 90 | return new static(sprintf('Unknown discriminator value "%s": %s', $value, $alias)); |
||
| 91 | } |
||
| 92 | |||
| 93 | public static function duplicateDiscriminatorEntry($name, array $duplicates, array $map) |
||
|
0 ignored issues
–
show
|
|||
| 94 | { |
||
| 95 | return new static( |
||
| 96 | sprintf('Discriminator map contains duplicate values "%s": %s', implode('", "', $duplicates), $name) |
||
| 97 | ); |
||
| 98 | } |
||
| 99 | |||
| 100 | public static function invalidClassInDiscriminatorMap($className, $name) |
||
| 101 | { |
||
| 102 | return new static( |
||
| 103 | sprintf('Invalid class "%s" for discriminator map: %s', $className, $name) |
||
| 104 | ); |
||
| 105 | } |
||
| 106 | } |
||
| 107 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.