#1130 DDC-3300 - minor refactoring (else
removal, spacing)
This commit is contained in:
parent
786c34faa5
commit
8579baf28c
1 changed files with 11 additions and 8 deletions
|
@ -2745,15 +2745,18 @@ class ClassMetadataInfo implements ClassMetadata
|
||||||
$className = ltrim($className, '\\');
|
$className = ltrim($className, '\\');
|
||||||
$this->discriminatorMap[$name] = $className;
|
$this->discriminatorMap[$name] = $className;
|
||||||
|
|
||||||
if ($this->name == $className) {
|
if ($this->name === $className) {
|
||||||
$this->discriminatorValue = $name;
|
$this->discriminatorValue = $name;
|
||||||
} else {
|
|
||||||
if ( ! class_exists($className) && ! interface_exists($className)) {
|
return;
|
||||||
throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
|
}
|
||||||
}
|
|
||||||
if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) {
|
if ( ! (class_exists($className) || interface_exists($className))) {
|
||||||
$this->subClasses[] = $className;
|
throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) {
|
||||||
|
$this->subClasses[] = $className;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue