Skip to content

Commit 2866a52

Browse files
committed
Added missing docblocks for MappingException
1 parent 70087c5 commit 2866a52

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

lib/Doctrine/ODM/MongoDB/Mapping/MappingException.php

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,49 @@
2929
*/
3030
class MappingException extends BaseMappingException
3131
{
32+
/**
33+
* @param string $name
34+
* @return MappingException
35+
*/
3236
public static function typeExists($name)
3337
{
3438
return new self('Type ' . $name . ' already exists.');
3539
}
3640

41+
/**
42+
* @param string $name
43+
* @return MappingException
44+
*/
3745
public static function typeNotFound($name)
3846
{
3947
return new self('Type to be overwritten ' . $name . ' does not exist.');
4048
}
4149

50+
/**
51+
* @param string $className
52+
* @param string $fieldName
53+
* @return MappingException
54+
*/
4255
public static function mappingNotFound($className, $fieldName)
4356
{
4457
return new self("No mapping found for field '$fieldName' in class '$className'.");
4558
}
4659

60+
/**
61+
* @param string $document
62+
* @param string $fieldName
63+
* @return MappingException
64+
*/
4765
public static function duplicateFieldMapping($document, $fieldName)
4866
{
4967
return new self('Property "' . $fieldName . '" in "' . $document . '" was already declared, but it must be declared only once');
5068
}
5169

70+
/**
71+
* @param string $document
72+
* @param string $fieldName
73+
* @return MappingException
74+
*/
5275
public static function discriminatorFieldConflict($document, $fieldName)
5376
{
5477
return new self('Discriminator field "' . $fieldName . '" in "' . $document . '" conflicts with a mapped field\'s "name" attribute.');
@@ -60,7 +83,7 @@ public static function discriminatorFieldConflict($document, $fieldName)
6083
*
6184
* @param string $className The class that could not be found
6285
* @param string $owningClass The class that declares the discriminator map.
63-
* @return self
86+
* @return MappingException
6487
*/
6588
public static function invalidClassInDiscriminatorMap($className, $owningClass)
6689
{
@@ -75,18 +98,26 @@ public static function invalidClassInDiscriminatorMap($className, $owningClass)
7598
*
7699
* @param string $value The discriminator value that could not be found
77100
* @param string $owningClass The class that declares the discriminator map
78-
* @return self
101+
* @return MappingException
79102
*/
80103
public static function invalidDiscriminatorValue($value, $owningClass)
81104
{
82105
return new self("Discriminator value '$value' used in the declaration of class '$owningClass' does not exist.");
83106
}
84107

108+
/**
109+
* @param string $className
110+
* @return MappingException
111+
*/
85112
public static function missingFieldName($className)
86113
{
87114
return new self("The Document class '$className' field mapping misses the 'fieldName' attribute.");
88115
}
89116

117+
/**
118+
* @param string $className
119+
* @return MappingException
120+
*/
90121
public static function classIsNotAValidDocument($className)
91122
{
92123
return new self('Class ' . $className . ' is not a valid document or mapped super class.');

0 commit comments

Comments
 (0)