From 86a114f07bde2d63895bb5e058e2332a39deaac6 Mon Sep 17 00:00:00 2001 From: Jakub Caban Date: Sun, 4 Apr 2021 14:12:38 +0200 Subject: [PATCH] Coding Standards --- .../ORM/Mapping/ClassMetadataInfo.php | 1 + .../Models/TypedProperties/UserTyped.php | 27 ++++----------- .../ORM/Mapping/AbstractMappingDriverTest.php | 1 + ...Tests.Models.TypedProperties.UserTyped.php | 33 +++++-------------- 4 files changed, 17 insertions(+), 45 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index f50ba925d96..bfc4e8ba4b5 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -1648,6 +1648,7 @@ protected function _validateAndCompleteAssociationMapping(array $mapping) $joinColumn['nullable'] = true; } } + unset($joinColumn); } diff --git a/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php b/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php index 744aa523a60..29e225b0f25 100644 --- a/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php +++ b/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php @@ -4,11 +4,10 @@ namespace Doctrine\Tests\Models\TypedProperties; -use Doctrine\ORM\Mapping as ORM; - use DateInterval; use DateTime; use DateTimeImmutable; +use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\Tests\Models\CMS\CmsEmail; @@ -93,34 +92,22 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); $metadata->mapField( - [ - 'fieldName' => 'dateInterval', - ] + ['fieldName' => 'dateInterval'] ); $metadata->mapField( - [ - 'fieldName' => 'dateTime', - ] + ['fieldName' => 'dateTime'] ); $metadata->mapField( - [ - 'fieldName' => 'dateTimeImmutable', - ] + ['fieldName' => 'dateTimeImmutable'] ); $metadata->mapField( - [ - 'fieldName' => 'array', - ] + ['fieldName' => 'array'] ); $metadata->mapField( - [ - 'fieldName' => 'boolean', - ] + ['fieldName' => 'boolean'] ); $metadata->mapField( - [ - 'fieldName' => 'float', - ] + ['fieldName' => 'float'] ); $metadata->mapOneToOne( diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index 691e2448341..05c1b8c4132 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -53,6 +53,7 @@ use function strtolower; use const CASE_UPPER; +use const PHP_VERSION_ID; abstract class AbstractMappingDriverTest extends OrmTestCase { diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php index 973df7f8801..e8247ebed7c 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php @@ -31,46 +31,29 @@ ] ); $metadata->mapField( - [ - 'fieldName' => 'dateInterval', - ] + ['fieldName' => 'dateInterval'] ); $metadata->mapField( - [ - 'fieldName' => 'dateTime', - ] + ['fieldName' => 'dateTime'] ); $metadata->mapField( - [ - 'fieldName' => 'dateTimeImmutable', - ] + ['fieldName' => 'dateTimeImmutable'] ); $metadata->mapField( - [ - 'fieldName' => 'array', - ] + ['fieldName' => 'array'] ); $metadata->mapField( - [ - 'fieldName' => 'boolean', - ] + ['fieldName' => 'boolean'] ); $metadata->mapField( - [ - 'fieldName' => 'float', - ] + ['fieldName' => 'float'] ); $metadata->mapOneToOne( [ 'fieldName' => 'email', - 'cascade' => - [0 => 'persist'], - 'joinColumns' => - [ - 0 => - [], - ], + 'cascade' => [0 => 'persist'], + 'joinColumns' => [[]], 'orphanRemoval' => true, ] );