diff --git a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php index dbb20cb80..2acc33225 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php +++ b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php @@ -33,8 +33,10 @@ class HydrationException extends \Doctrine\ORM\ORMException */ public static function missingDiscriminatorColumn($entityName, $discrColumnName, $dqlAlias) { - return new self("The discriminator column '$discrColumnName' " - . "is missing for '$entityName' using the DQL alias '$dqlAlias'."); + return new self(sprintf( + 'The discriminator column "%s" is missing for "%s" using the DQL alias "%s".', + $discrColumnName, $entityName, $dqlAlias + )); } /** @@ -46,7 +48,9 @@ class HydrationException extends \Doctrine\ORM\ORMException */ public static function missingDiscriminatorMetaMappingColumn($entityName, $discrColumnName, $dqlAlias) { - return new self("The meta mapping for the discriminator column '$discrColumnName' " - . "is missing for '$entityName' using the DQL alias '$dqlAlias'."); + return new self(sprintf( + 'The meta mapping for the discriminator column "%s" is missing for "%s" using the DQL alias "%s".', + $discrColumnName, $entityName, $dqlAlias + )); } } \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index d82a181c3..52de2c159 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -218,13 +218,13 @@ class ObjectHydrator extends AbstractHydrator if (isset($this->_rsm->discriminatorColumns[$dqlAlias])) { - if (!isset($this->_rsm->metaMappings[$this->_rsm->discriminatorColumns[$dqlAlias]])) { + if ( ! isset($this->_rsm->metaMappings[$this->_rsm->discriminatorColumns[$dqlAlias]])) { throw HydrationException::missingDiscriminatorMetaMappingColumn($className, $this->_rsm->discriminatorColumns[$dqlAlias], $dqlAlias); } $discrColumn = $this->_rsm->metaMappings[$this->_rsm->discriminatorColumns[$dqlAlias]]; - if (!isset($data[$discrColumn])) { + if ( ! isset($data[$discrColumn])) { throw HydrationException::missingDiscriminatorColumn($className, $discrColumn, $dqlAlias); } @@ -339,7 +339,7 @@ class ObjectHydrator extends AbstractHydrator $path = $parentAlias . '.' . $dqlAlias; // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs - if (!isset($nonemptyComponents[$parentAlias])) { + if ( ! isset($nonemptyComponents[$parentAlias])) { // TODO: Add special case code where we hydrate the right join objects into identity map at least continue; } diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index 371081ccf..4dc558441 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -92,7 +92,7 @@ class SimpleObjectHydrator extends AbstractHydrator if ($this->class->inheritanceType !== ClassMetadata::INHERITANCE_TYPE_NONE) { $discrColumnName = $this->_platform->getSQLResultCasing($this->class->discriminatorColumn['name']); - if (!isset($sqlResult[$discrColumnName])) { + if ( ! isset($sqlResult[$discrColumnName])) { throw HydrationException::missingDiscriminatorColumn($entityName, $discrColumnName, key($this->_rsm->aliasMap)); } diff --git a/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php b/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php index cb0dd1f17..33636b4ec 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php @@ -1869,7 +1869,7 @@ class ObjectHydratorTest extends HydrationTestCase * @group DDC-1470 * * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The meta mapping for the discriminator column 'c_discr' is missing for 'Doctrine\Tests\Models\Company\CompanyFixContract' using the DQL alias 'c'. + * @expectedExceptionMessage The meta mapping for the discriminator column "c_discr" is missing for "Doctrine\Tests\Models\Company\CompanyFixContract" using the DQL alias "c". */ public function testMissingMetaMappingException() { @@ -1897,7 +1897,7 @@ class ObjectHydratorTest extends HydrationTestCase * @group DDC-1470 * * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The discriminator column 'discr' is missing for 'Doctrine\Tests\Models\Company\CompanyEmployee' using the DQL alias 'e'. + * @expectedExceptionMessage The discriminator column "discr" is missing for "Doctrine\Tests\Models\Company\CompanyEmployee" using the DQL alias "e". */ public function testMissingDiscriminatorColumnException() { diff --git a/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php b/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php index 5e718c58c..80f90e7ff 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php @@ -13,7 +13,7 @@ class SimpleObjectHydratorTest extends HydrationTestCase * @group DDC-1470 * * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The discriminator column 'discr' is missing for 'Doctrine\Tests\Models\Company\CompanyPerson' using the DQL alias 'p'. + * @expectedExceptionMessage The discriminator column "discr" is missing for "Doctrine\Tests\Models\Company\CompanyPerson" using the DQL alias "p". */ public function testMissingDiscriminatorColumnException() {