From 4aece04ae79827373822dea11195cd2267357f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 15 Feb 2021 23:56:11 +0100 Subject: [PATCH 1/2] Automatically fix cs --- tests/Doctrine/Tests/Models/CMS/CmsAddress.php | 1 + tests/Doctrine/Tests/Models/CMS/CmsComment.php | 2 ++ tests/Doctrine/Tests/Models/CMS/CmsEmployee.php | 1 + tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php | 1 + tests/Doctrine/Tests/Models/Cache/Login.php | 1 + tests/Doctrine/Tests/Models/Company/CompanyManager.php | 1 + tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php | 1 + tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php | 1 + tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php | 2 ++ tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php | 1 + tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php | 1 + tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php | 2 ++ tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php | 2 ++ tests/Doctrine/Tests/Models/Forum/ForumBoard.php | 1 + .../Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php | 1 + tests/Doctrine/Tests/Models/GeoNames/Admin1.php | 1 + tests/Doctrine/Tests/Models/Pagination/Logo.php | 1 + tests/Doctrine/Tests/Models/Quote/NumericEntity.php | 1 + tests/Doctrine/Tests/Models/Quote/Phone.php | 1 + tests/Doctrine/Tests/Models/Routing/RoutingLeg.php | 2 ++ tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php | 1 + .../Models/ValueConversionType/OwningManyToOneEntity.php | 1 + .../ValueConversionType/OwningManyToOneExtraLazyEntity.php | 1 + .../Models/ValueConversionType/OwningOneToOneEntity.php | 1 + .../Tests/ORM/Functional/AdvancedAssociationTest.php | 5 +++++ .../Tests/ORM/Functional/ClassTableInheritanceTest2.php | 1 + tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php | 1 + .../Tests/ORM/Functional/OneToOneEagerLoadingTest.php | 1 + .../Functional/OneToOneSelfReferentialAssociationTest.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php | 4 ++++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php | 2 ++ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php | 1 + 51 files changed, 71 insertions(+) diff --git a/tests/Doctrine/Tests/Models/CMS/CmsAddress.php b/tests/Doctrine/Tests/Models/CMS/CmsAddress.php index 56c219732e..4f3f866d04 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsAddress.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsAddress.php @@ -85,6 +85,7 @@ class CmsAddress public $street; /** + * @var CmsUser * @OneToOne(targetEntity="CmsUser", inversedBy="address") * @JoinColumn(referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/CMS/CmsComment.php b/tests/Doctrine/Tests/Models/CMS/CmsComment.php index 1707501290..75a41c2ee3 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsComment.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsComment.php @@ -11,6 +11,7 @@ class CmsComment { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") @@ -27,6 +28,7 @@ class CmsComment */ public $text; /** + * @var CmsArticle * @ManyToOne(targetEntity="CmsArticle", inversedBy="comments") * @JoinColumn(name="article_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php b/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php index c8835790ce..dbbe5f8f71 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php @@ -24,6 +24,7 @@ class CmsEmployee private $name; /** + * @var CmsEmployee * @OneToOne(targetEntity="CmsEmployee") * @JoinColumn(name="spouse_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php b/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php index 7f24c63246..5ff4c4a40c 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php @@ -13,6 +13,7 @@ class CmsPhonenumber /** @Id @Column(length=50) */ public $phonenumber; /** + * @var CmsUser * @ManyToOne(targetEntity="CmsUser", inversedBy="phonenumbers", cascade={"merge"}) * @JoinColumn(name="user_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/Cache/Login.php b/tests/Doctrine/Tests/Models/Cache/Login.php index 01f341d76b..3e5fee2f71 100644 --- a/tests/Doctrine/Tests/Models/Cache/Login.php +++ b/tests/Doctrine/Tests/Models/Cache/Login.php @@ -22,6 +22,7 @@ class Login public $name; /** + * @var Token * @ManyToOne(targetEntity="Token", cascade={"persist", "remove"}, inversedBy="logins") * @JoinColumn(name="token_id", referencedColumnName="token") */ diff --git a/tests/Doctrine/Tests/Models/Company/CompanyManager.php b/tests/Doctrine/Tests/Models/Company/CompanyManager.php index 341d726f0f..02ae9781e4 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyManager.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyManager.php @@ -19,6 +19,7 @@ class CompanyManager extends CompanyEmployee private $title; /** + * @var CompanyCar * @OneToOne(targetEntity="CompanyCar", cascade={"persist"}) * @JoinColumn(name="car_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php b/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php index 5def2d0ff5..db344373c1 100644 --- a/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php +++ b/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php @@ -18,6 +18,7 @@ class DDC117ApproveChanges private $id; /** + * @var DDC117ArticleDetails * @ManyToOne(targetEntity="DDC117ArticleDetails") * @JoinColumn(name="details_id", referencedColumnName="article_id") */ diff --git a/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php b/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php index 6a5c763d4b..c7eeaa179e 100644 --- a/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php +++ b/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php @@ -13,6 +13,7 @@ trait DDC1872ExampleTrait protected $foo; /** + * @var DDC1872Bar * @OneToOne(targetEntity="DDC1872Bar", cascade={"persist", "merge"}) * @JoinColumn(name="example_trait_bar_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php index 92a62d85f1..8159cfd3e9 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php @@ -16,6 +16,7 @@ class ECommerceCart { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue @@ -26,6 +27,7 @@ class ECommerceCart private $payment; /** + * @var ECommerceCustomer * @OneToOne(targetEntity="ECommerceCustomer", inversedBy="cart") * @JoinColumn(name="customer_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php index 32e332f7ce..226472d6cd 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php @@ -39,6 +39,7 @@ class ECommerceCategory private $children; /** + * @var ECommerceCategory * @ManyToOne(targetEntity="ECommerceCategory", inversedBy="children") * @JoinColumn(name="parent_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php index f63a7fb584..af2ba454c3 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php @@ -14,6 +14,7 @@ class ECommerceCustomer { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php index eca5c19bb0..49f8ce3fa3 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php @@ -13,6 +13,7 @@ class ECommerceFeature { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue @@ -23,6 +24,7 @@ class ECommerceFeature private $description; /** + * @var ECommerceProduct * @ManyToOne(targetEntity="ECommerceProduct", inversedBy="features") * @JoinColumn(name="product_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php index b95de13852..57b7761768 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php @@ -16,6 +16,7 @@ class ECommerceProduct { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue @@ -29,6 +30,7 @@ class ECommerceProduct private $name; /** + * @var ECommerceShipping * @OneToOne(targetEntity="ECommerceShipping", cascade={"persist"}) * @JoinColumn(name="shipping_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/Forum/ForumBoard.php b/tests/Doctrine/Tests/Models/Forum/ForumBoard.php index eda1715036..b5c7a23ef4 100644 --- a/tests/Doctrine/Tests/Models/Forum/ForumBoard.php +++ b/tests/Doctrine/Tests/Models/Forum/ForumBoard.php @@ -24,6 +24,7 @@ class ForumBoard */ public $position; /** + * @var ForumCategory * @ManyToOne(targetEntity="ForumCategory", inversedBy="boards") * @JoinColumn(name="category_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php b/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php index d58a5f8763..fd6d5c5082 100644 --- a/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php +++ b/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php @@ -11,6 +11,7 @@ class NonAlphaColumnsEntity { /** + * @var int * @Id * @Column(type="integer", name="`simple-entity-id`") * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/Models/GeoNames/Admin1.php b/tests/Doctrine/Tests/Models/GeoNames/Admin1.php index 39981b2562..65cc5d0bef 100644 --- a/tests/Doctrine/Tests/Models/GeoNames/Admin1.php +++ b/tests/Doctrine/Tests/Models/GeoNames/Admin1.php @@ -12,6 +12,7 @@ class Admin1 { /** + * @var int * @Id * @Column(type="integer", length=25) * @GeneratedValue(strategy="NONE") diff --git a/tests/Doctrine/Tests/Models/Pagination/Logo.php b/tests/Doctrine/Tests/Models/Pagination/Logo.php index 2a2748074d..5ac0e96a8b 100644 --- a/tests/Doctrine/Tests/Models/Pagination/Logo.php +++ b/tests/Doctrine/Tests/Models/Pagination/Logo.php @@ -38,6 +38,7 @@ class Logo public $image_width; /** + * @var Company * @OneToOne(targetEntity="Company", inversedBy="logo", cascade={"persist"}) * @JoinColumn(name="company_id") */ diff --git a/tests/Doctrine/Tests/Models/Quote/NumericEntity.php b/tests/Doctrine/Tests/Models/Quote/NumericEntity.php index ac50f304bc..9b0f7aa47c 100644 --- a/tests/Doctrine/Tests/Models/Quote/NumericEntity.php +++ b/tests/Doctrine/Tests/Models/Quote/NumericEntity.php @@ -11,6 +11,7 @@ class NumericEntity { /** + * @var int * @Id * @Column(type="integer", name="`1:1`") * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/Models/Quote/Phone.php b/tests/Doctrine/Tests/Models/Quote/Phone.php index 950c9d757d..e9e14bfaa5 100644 --- a/tests/Doctrine/Tests/Models/Quote/Phone.php +++ b/tests/Doctrine/Tests/Models/Quote/Phone.php @@ -17,6 +17,7 @@ class Phone public $number; /** + * @var User * @ManyToOne(targetEntity="User", inversedBy="phones") * @JoinColumn(name="`user-id`", referencedColumnName="`user-id`") */ diff --git a/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php b/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php index b6a2db8fb0..305739d228 100644 --- a/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php +++ b/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php @@ -16,12 +16,14 @@ class RoutingLeg public $id; /** + * @var RoutingLocation * @ManyToOne(targetEntity="RoutingLocation") * @JoinColumn(name="from_id", referencedColumnName="id") */ public $fromLocation; /** + * @var RoutingLocation * @ManyToOne(targetEntity="RoutingLocation") * @JoinColumn(name="to_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php b/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php index 664657f2e0..e1a1628b18 100644 --- a/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php +++ b/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php @@ -18,6 +18,7 @@ class RoutingRouteBooking public $id; /** + * @var RoutingRoute * @ManyToOne(targetEntity="RoutingRoute", inversedBy="bookings") * @JoinColumn(name="route_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneEntity.php b/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneEntity.php index 55e7c4e51f..1b5d2120ab 100644 --- a/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneEntity.php +++ b/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneEntity.php @@ -17,6 +17,7 @@ class OwningManyToOneEntity public $id2; /** + * @var InversedOneToManyEntity * @ManyToOne(targetEntity="InversedOneToManyEntity", inversedBy="associatedEntities") * @JoinColumn(name="associated_id", referencedColumnName="id1") */ diff --git a/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneExtraLazyEntity.php b/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneExtraLazyEntity.php index 549bc0b9cb..831136b21b 100644 --- a/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneExtraLazyEntity.php +++ b/tests/Doctrine/Tests/Models/ValueConversionType/OwningManyToOneExtraLazyEntity.php @@ -17,6 +17,7 @@ class OwningManyToOneExtraLazyEntity public $id2; /** + * @var InversedOneToManyExtraLazyEntity * @ManyToOne(targetEntity="InversedOneToManyExtraLazyEntity", inversedBy="associatedEntities") * @JoinColumn(name="associated_id", referencedColumnName="id1") */ diff --git a/tests/Doctrine/Tests/Models/ValueConversionType/OwningOneToOneEntity.php b/tests/Doctrine/Tests/Models/ValueConversionType/OwningOneToOneEntity.php index 611db24ccd..4ffed7eeb2 100644 --- a/tests/Doctrine/Tests/Models/ValueConversionType/OwningOneToOneEntity.php +++ b/tests/Doctrine/Tests/Models/ValueConversionType/OwningOneToOneEntity.php @@ -17,6 +17,7 @@ class OwningOneToOneEntity public $id2; /** + * @var InversedOneToOneEntity * @OneToOne(targetEntity="InversedOneToOneEntity", inversedBy="associatedEntity") * @JoinColumn(name="associated_id", referencedColumnName="id1") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php index 9f315d8bd1..099225319f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php @@ -327,6 +327,7 @@ class Phrase public const CLASS_NAME = self::class; /** + * @var int * @Id * @Column(type="integer", name="phrase_id") * @GeneratedValue(strategy="AUTO") @@ -340,6 +341,7 @@ class Phrase private $phrase; /** + * @var PhraseType * @ManyToOne(targetEntity="PhraseType") * @JoinColumn(name="phrase_type_id", referencedColumnName="phrase_type_id") */ @@ -399,6 +401,7 @@ class PhraseType public const CLASS_NAME = self::class; /** + * @var int * @Id * @Column(type="integer", name="phrase_type_id") * @GeneratedValue(strategy="AUTO") @@ -470,6 +473,7 @@ class Definition public const CLASS_NAME = self::class; /** + * @var int * @Id * @Column(type="integer", name="definition_id") * @GeneratedValue(strategy="AUTO") @@ -477,6 +481,7 @@ class Definition private $id; /** + * @var Phrase * @ManyToOne(targetEntity="Phrase") * @JoinColumn(name="definition_phrase_id", referencedColumnName="phrase_id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php index 764f568d70..1e54bcd14a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php @@ -153,6 +153,7 @@ class CTIRelated private $id; /** + * @var CTIParent * @OneToOne(targetEntity="CTIParent") * @JoinColumn(name="ctiparent_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php index 097d7249a5..0b1f77d061 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php @@ -161,6 +161,7 @@ class DefaultValueAddress public $street; /** + * @var DefaultValueUser * @OneToOne(targetEntity="DefaultValueUser") * @JoinColumn(name="user_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php index 4a8bf25203..c940e46fcd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php @@ -357,6 +357,7 @@ class Waggon /** @id @generatedValue @column(type="integer") */ public $id; /** + * @var Train * @ManyToOne(targetEntity="Train", inversedBy="waggons", fetch="EAGER") * @JoinColumn(nullable=false) */ diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php index ee847e5226..47426acbbe 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php @@ -155,11 +155,13 @@ class MultiSelfReference /** @Id @GeneratedValue(strategy="AUTO") @Column(type="integer") */ private $id; /** + * @var MultiSelfReference * @OneToOne(targetEntity="MultiSelfReference", cascade={"persist"}) * @JoinColumn(name="other1", referencedColumnName="id") */ private $other1; /** + * @var MultiSelfReference * @OneToOne(targetEntity="MultiSelfReference", cascade={"persist"}) * @JoinColumn(name="other2", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php index 1aaff71a7b..71ec2fc0f1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php @@ -212,6 +212,7 @@ class DDC1335Phone public $numericalValue; /** + * @var DDC1335User * @ManyToOne(targetEntity="DDC1335User", inversedBy="phones") * @JoinColumn(name="user_id", referencedColumnName="id", nullable = false) */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php index dda2f83968..727bb60670 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php @@ -84,6 +84,7 @@ class DDC1392Picture private $pictureId; /** + * @var DDC1392File * @ManyToOne(targetEntity="DDC1392File", cascade={"persist", "remove"}) * @JoinColumn(name="file_id", referencedColumnName="file_id") */ @@ -120,6 +121,7 @@ public function getFile() class DDC1392File { /** + * @var int * @Column(name="file_id", type="integer") * @Id * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php index b7f9a56a30..b7c1606a27 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php @@ -71,6 +71,7 @@ class DDC1436Page */ protected $id; /** + * @var DDC1436Page * @ManyToOne(targetEntity="DDC1436Page") * @JoinColumn(name="pid", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php index 03860ce117..dd0e261504 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php @@ -66,6 +66,7 @@ public function testFailingCase(): void class DDC1509Picture { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") @@ -128,6 +129,7 @@ public function setThumbnail($thumbnail): void class DDC1509AbstractFile { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php index ed82ae257e..48217e0a5a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php @@ -56,6 +56,7 @@ public function testIssue(): void class DDC1526Menu { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php index 3f8d1b6cf8..a94a35a622 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php @@ -100,6 +100,7 @@ public function testCreateRetrieveUpdateDelete(): void class DDC1719SimpleEntity { /** + * @var int * @Id * @Column(type="integer", name="`simple-entity-id`") * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php index 9e72c5f896..1b43010895 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php @@ -40,6 +40,7 @@ public function testFailingCase(): void class DDC1757A { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") @@ -53,6 +54,7 @@ class DDC1757A class DDC1757B { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") @@ -72,6 +74,7 @@ class DDC1757B class DDC1757C { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") @@ -91,6 +94,7 @@ class DDC1757C class DDC1757D { /** + * @var int * @Column(type="integer") * @Id * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php index cd602a04b3..e4de2638ea 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php @@ -102,6 +102,7 @@ class DDC199RelatedClass public $relatedData; /** + * @var DDC199ParentClass * @ManyToOne(targetEntity="DDC199ParentClass", inversedBy="relatedEntities") * @JoinColumn(name="parent_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php index 316bb57659..a3c97f3805 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php @@ -63,6 +63,7 @@ class DDC2182OptionChild private $id; /** + * @var DDC2182OptionParent * @ManyToOne(targetEntity="DDC2182OptionParent") * @JoinColumn(referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php index 70abe33129..48c4e55ede 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php @@ -87,6 +87,7 @@ class DDC2256User public $name; /** + * @var DDC2256Group * @ManyToOne(targetEntity="DDC2256Group", inversedBy="users")A * @JoinColumn(name="group_id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php index 251699d0db..52dccd5c75 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php @@ -86,6 +86,7 @@ class DDC237EntityX */ public $data; /** + * @var DDC237EntityY * @OneToOne(targetEntity="DDC237EntityY") * @JoinColumn(name="y_id", referencedColumnName="id") */ @@ -127,6 +128,7 @@ class DDC237EntityZ public $data; /** + * @var DDC237EntityY * @OneToOne(targetEntity="DDC237EntityY") * @JoinColumn(name="y_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php index 26f19164e8..1b2e5c91f4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php @@ -129,6 +129,7 @@ class DDC2575A public $rootRelation; /** + * @var DDC2575B * @ManyToOne(targetEntity="DDC2575B") * @JoinColumn(name="b_id", referencedColumnName="id", nullable=FALSE, onDelete="CASCADE") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php index 476911e144..ce67b44e2d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php @@ -90,6 +90,7 @@ abstract class DDC279EntityXAbstract class DDC279EntityX extends DDC279EntityXAbstract { /** + * @var DDC279EntityY * @OneToOne(targetEntity="DDC279EntityY") * @JoinColumn(name="y_id", referencedColumnName="id") */ @@ -111,6 +112,7 @@ class DDC279EntityY public $data; /** + * @var DDC279EntityZ * @OneToOne(targetEntity="DDC279EntityZ") * @JoinColumn(name="z_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php index 6329df3c26..1f0d8c555a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php @@ -132,12 +132,14 @@ class DDC345Membership public $id; /** + * @var DDC345User * @OneToOne(targetEntity="DDC345User", inversedBy="Memberships") * @JoinColumn(name="user_id", referencedColumnName="id", nullable=false) */ public $user; /** + * @var DDC345Group * @OneToOne(targetEntity="DDC345Group", inversedBy="Memberships") * @JoinColumn(name="group_id", referencedColumnName="id", nullable=false) */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php index 588c56257c..0476de418f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php @@ -140,6 +140,7 @@ public function getFile() class DDC353File { /** + * @var int * @Column(name="file_id", type="integer") * @Id * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php index c407bbff5f..b9c9a4e969 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php @@ -193,6 +193,7 @@ class DDC3644Address public $id; /** + * @var DDC3644User * @ManyToOne(targetEntity="DDC3644User", inversedBy="addresses") * @JoinColumn(referencedColumnName="hash_id") */ @@ -244,6 +245,7 @@ public function __construct($name) class DDC3644Pet extends DDC3644Animal { /** + * @var DDC3644User * @ManyToOne(targetEntity="DDC3644User", inversedBy="pets") * @JoinColumn(referencedColumnName="hash_id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php index 11330aa189..1ed27cf5b7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php @@ -150,6 +150,7 @@ public function setId(int $value): void class DDC440Client { /** + * @var int * @Column(name="id", type="integer") * @Id * @GeneratedValue(strategy="AUTO") diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php index 14a21dcfb6..3e53fd25a8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php @@ -52,6 +52,7 @@ class DDC448MainTable private $id; /** + * @var DDC448ConnectedClass * @ManyToOne(targetEntity="DDC448ConnectedClass", cascade={"all"}, fetch="EAGER") * @JoinColumn(name="connectedClassId", referencedColumnName="id", onDelete="CASCADE", nullable=true) */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php index 7036a2123d..2cec2dd317 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php @@ -48,6 +48,7 @@ class DDC493Customer */ public $id; /** + * @var DDC493Contact * @OneToOne(targetEntity="DDC493Contact", cascade={"remove","persist"}) * @JoinColumn(name="contact", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php index 148d8f5657..e8aa9e7ff9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php @@ -56,6 +56,7 @@ class DDC513Item public $id; /** + * @var DDC513Price * @OneToOne(targetEntity="DDC513Price", cascade={"remove","persist"}) * @JoinColumn(name="price", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php index ffe4f55552..5c58c82b8f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php @@ -131,6 +131,7 @@ class DDC522Cart public $total; /** + * @var DDC522Customer * @OneToOne(targetEntity="DDC522Customer", inversedBy="cart") * @JoinColumn(name="customer", referencedColumnName="id") */ @@ -152,6 +153,7 @@ class DDC522ForeignKeyTest public $cartId; /** + * @var DDC522Cart * @OneToOne(targetEntity="DDC522Cart") * @JoinColumn(name="cart_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php index 9c705b62ff..50092c480a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php @@ -38,6 +38,7 @@ public function testIssue(): void class DDC588Site { /** + * @var int * @Id * @Column(type="integer", name="site_id") * @GeneratedValue From d76cbd755fb6c856b9d3c71d58f1ad265bee9a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 16 Feb 2021 08:12:36 +0100 Subject: [PATCH 2/2] Manually fix cs --- .../CustomType/CustomIdObjectTypeChild.php | 5 ++- .../Tests/Models/Forum/ForumAdministrator.php | 5 ++- .../Doctrine/Tests/Models/GeoNames/Admin1.php | 5 ++- .../Models/GeoNames/Admin1AlternateName.php | 5 ++- tests/Doctrine/Tests/Models/GeoNames/City.php | 5 ++- .../Tests/Models/GeoNames/Country.php | 5 ++- tests/Doctrine/Tests/Models/Taxi/Car.php | 5 ++- tests/Doctrine/Tests/Models/Taxi/Driver.php | 5 ++- .../Functional/MergeSharedEntitiesTest.php | 21 +++++++++++-- .../ORM/Functional/SchemaTool/DBAL483Test.php | 5 ++- .../SchemaTool/MySqlSchemaToolTest.php | 7 ++++- .../ORM/Functional/Ticket/DDC3303Test.php | 22 ++++++++++--- .../ORM/Functional/Ticket/DDC3785Test.php | 9 ++++-- .../ORM/Functional/Ticket/DDC381Test.php | 2 +- .../ORM/Functional/Ticket/DDC3967Test.php | 4 +-- .../ORM/Functional/Ticket/DDC422Test.php | 4 ++- .../ORM/Functional/Ticket/DDC425Test.php | 8 +++-- .../ORM/Functional/Ticket/DDC440Test.php | 31 ++++++++++++------- .../ORM/Functional/Ticket/DDC444Test.php | 8 +++-- .../ORM/Functional/Ticket/DDC501Test.php | 2 +- .../ORM/Functional/Ticket/DDC512Test.php | 1 + .../ORM/Functional/Ticket/DDC522Test.php | 10 ++++-- .../ORM/Functional/Ticket/DDC531Test.php | 14 +++++++-- .../ORM/Functional/Ticket/DDC5684Test.php | 11 ++++++- 24 files changed, 151 insertions(+), 48 deletions(-) diff --git a/tests/Doctrine/Tests/Models/CustomType/CustomIdObjectTypeChild.php b/tests/Doctrine/Tests/Models/CustomType/CustomIdObjectTypeChild.php index 34c06a6352..836d16d1a6 100644 --- a/tests/Doctrine/Tests/Models/CustomType/CustomIdObjectTypeChild.php +++ b/tests/Doctrine/Tests/Models/CustomType/CustomIdObjectTypeChild.php @@ -18,7 +18,10 @@ class CustomIdObjectTypeChild */ public $id; - /** @ManyToOne(targetEntity="Doctrine\Tests\Models\CustomType\CustomIdObjectTypeParent", inversedBy="children") */ + /** + * @var CustomIdObjectTypeParent + * @ManyToOne(targetEntity="Doctrine\Tests\Models\CustomType\CustomIdObjectTypeParent", inversedBy="children") + */ public $parent; public function __construct(CustomIdObject $id, CustomIdObjectTypeParent $parent) diff --git a/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php b/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php index 3e237659c9..eb3b65a9cc 100644 --- a/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php +++ b/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php @@ -9,6 +9,9 @@ */ class ForumAdministrator extends ForumUser { - /** @Column(type="integer", name="access_level") */ + /** + * @var int + * @Column(type="integer", name="access_level") + */ public $accessLevel; } diff --git a/tests/Doctrine/Tests/Models/GeoNames/Admin1.php b/tests/Doctrine/Tests/Models/GeoNames/Admin1.php index 65cc5d0bef..52e3139e3b 100644 --- a/tests/Doctrine/Tests/Models/GeoNames/Admin1.php +++ b/tests/Doctrine/Tests/Models/GeoNames/Admin1.php @@ -33,7 +33,10 @@ class Admin1 */ public $names = []; - /** @Column(type="string", length=255); */ + /** + * @var string + * @Column(type="string", length=255); + */ public $name; public function __construct($id, $name, Country $country) diff --git a/tests/Doctrine/Tests/Models/GeoNames/Admin1AlternateName.php b/tests/Doctrine/Tests/Models/GeoNames/Admin1AlternateName.php index 2611636e24..0b64cdfd14 100644 --- a/tests/Doctrine/Tests/Models/GeoNames/Admin1AlternateName.php +++ b/tests/Doctrine/Tests/Models/GeoNames/Admin1AlternateName.php @@ -29,7 +29,10 @@ class Admin1AlternateName */ public $admin1; - /** @Column(type="string", length=255); */ + /** + * @var string + * @Column(type="string", length=255); + */ public $name; public function __construct($id, $name, Admin1 $admin1) diff --git a/tests/Doctrine/Tests/Models/GeoNames/City.php b/tests/Doctrine/Tests/Models/GeoNames/City.php index aacd056fbf..41761393c6 100644 --- a/tests/Doctrine/Tests/Models/GeoNames/City.php +++ b/tests/Doctrine/Tests/Models/GeoNames/City.php @@ -36,7 +36,10 @@ class City */ public $admin1; - /** @Column(type="string", length=255); */ + /** + * @var string + * @Column(type="string", length=255); + */ public $name; public function __construct($id, $name) diff --git a/tests/Doctrine/Tests/Models/GeoNames/Country.php b/tests/Doctrine/Tests/Models/GeoNames/Country.php index 4ff1cc835b..08fc873eb0 100644 --- a/tests/Doctrine/Tests/Models/GeoNames/Country.php +++ b/tests/Doctrine/Tests/Models/GeoNames/Country.php @@ -19,7 +19,10 @@ class Country */ public $id; - /** @Column(type="string", length=255); */ + /** + * @var string + * @Column(type="string", length=255); + */ public $name; public function __construct($id, $name) diff --git a/tests/Doctrine/Tests/Models/Taxi/Car.php b/tests/Doctrine/Tests/Models/Taxi/Car.php index 50e54f4238..038427bf3b 100644 --- a/tests/Doctrine/Tests/Models/Taxi/Car.php +++ b/tests/Doctrine/Tests/Models/Taxi/Car.php @@ -18,7 +18,10 @@ class Car */ private $brand; - /** @Column(type="string", length=255); */ + /** + * @var string + * @Column(type="string", length=255); + */ private $model; /** @OneToMany(targetEntity="Ride", mappedBy="car") */ diff --git a/tests/Doctrine/Tests/Models/Taxi/Driver.php b/tests/Doctrine/Tests/Models/Taxi/Driver.php index 312a54330b..4ab7def267 100644 --- a/tests/Doctrine/Tests/Models/Taxi/Driver.php +++ b/tests/Doctrine/Tests/Models/Taxi/Driver.php @@ -18,7 +18,10 @@ class Driver */ private $id; - /** @Column(type="string", length=255); */ + /** + * @var string + * @Column(type="string", length=255); + */ private $name; /** @OneToMany(targetEntity="Ride", mappedBy="driver") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php index 70465244a4..852e29ec5e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php @@ -110,7 +110,12 @@ public function testMergeInheritedTransientPrivateProperties(): void /** @Entity */ class MSEPicture { - /** @Column(type="integer") @Id @GeneratedValue */ + /** + * @var int + * @Column(type="integer") + * @Id + * @GeneratedValue + */ public $id; /** @@ -129,7 +134,12 @@ class MSEPicture /** @Entity */ class MSEFile { - /** @Column(type="integer") @Id @GeneratedValue(strategy="AUTO") */ + /** + * @var int + * @Column(type="integer") + * @Id + * @GeneratedValue(strategy="AUTO") + */ public $id; } @@ -152,6 +162,11 @@ public function setSession($session): void /** @Entity */ class MSEAdmin extends MSEUser { - /** @Column(type="integer") @Id @GeneratedValue(strategy="NONE") */ + /** + * @var int + * @Column(type="integer") + * @Id + * @GeneratedValue(strategy="NONE") + */ public $id; } diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php index 7dec236c3c..18ae637130 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php @@ -54,7 +54,10 @@ class DBAL483Default */ public $id; - /** @Column(type="integer", options={"default": 0}) */ + /** + * @var int + * @Column(type="integer", options={"default": 0}) + */ public $num; /** diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php index 032835fd28..25c28eed09 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php @@ -109,6 +109,11 @@ public function testGetCreateSchemaSql4(): void */ class MysqlSchemaNamespacedEntity { - /** @Column(type="integer") @Id @GeneratedValue */ + /** + * @var int + * @Column(type="integer") + * @Id + * @GeneratedValue + */ public $id; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php index 7a7276ff30..0dd3f1d712 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php @@ -59,16 +59,25 @@ public function __construct($name, DDC3303Address $address) */ class DDC3303Address { - /** @Column(type="string") @var string */ + /** + * @var string + * @Column(type="string") + */ private $street; - /** @Column(type="integer") @var int */ + /** + * @var int + * @Column(type="integer") + */ private $number; - /** @Column(type="string") @var string */ + /** + * @var string + * @Column(type="string") + */ private $city; - public function __construct($street, $number, $city) + public function __construct(string $street, int $number, string $city) { $this->street = $street; $this->number = $number; @@ -82,7 +91,10 @@ public function __construct($street, $number, $city) */ class DDC3303Employee extends DDC3303Person { - /** @Column(type="string") @var string */ + /** + * @var string + * @Column(type="string") + */ private $company; public function __construct($name, DDC3303Address $address, $company) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php index 6359225894..f6cef2bc13 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php @@ -126,15 +126,18 @@ public function __construct($name, $value) /** @Embeddable */ class DDC3785_AssetId { - /** @Column(type = "guid") */ + /** + * @var string + * @Column(type = "guid") + */ private $id; - public function __construct($id) + public function __construct(string $id) { $this->id = $id; } - public function __toString() + public function __toString(): string { return $this->id; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php index 115e4b8bb5..2fa7a74a18 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php @@ -60,7 +60,7 @@ class DDC381Entity */ protected $id; - public function getId() + public function getId(): int { return $this->id; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php index 8fb691fc69..c66b4b8e61 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php @@ -27,10 +27,10 @@ public function testIdentifierCachedWithProperType(): void $id = $country->getId(); // First time, loaded from database - $this->_em->find(Country::class, "$id"); + $this->_em->find(Country::class, (string) $id); $this->_em->clear(); - $country = $this->_em->find(Country::class, "$id"); + $country = $this->_em->find(Country::class, (string) $id); assert($country instanceof Country); // Identifier type should be integer diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php index 97275200bd..901c131fdc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php @@ -5,6 +5,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\Collection; use Doctrine\ORM\PersistentCollection; use Doctrine\Tests\OrmFunctionalTestCase; @@ -70,11 +71,12 @@ class DDC422Guest class DDC422Customer extends DDC422Guest { /** + * @var Collection * @ManyToMany(targetEntity="DDC422Contact", cascade={"persist","remove"}) * @JoinTable(name="ddc422_customers_contacts", * joinColumns={@JoinColumn(name="customer_id", referencedColumnName="id", onDelete="cascade" )}, * inverseJoinColumns={@JoinColumn(name="contact_id", referencedColumnName="id", onDelete="cascade" )} - * ) + * ) */ public $contacts; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php index 09bad77faf..d9c9eebdbf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php @@ -4,7 +4,8 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use DateTime, Doctrine\DBAL\Types\Type; +use DateTime; +use Doctrine\DBAL\Types\Type; use Doctrine\Tests\OrmFunctionalTestCase; class DDC425Test extends OrmFunctionalTestCase @@ -43,6 +44,9 @@ class DDC425Entity */ public $id; - /** @Column(type="datetime") */ + /** + * @var DateTime + * @Column(type="datetime") + */ public $someDatetimeField; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php index 1ed27cf5b7..f8500b53db 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php @@ -4,6 +4,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; +use Doctrine\Common\Collections\Collection; use Doctrine\Tests\OrmFunctionalTestCase; use Exception; @@ -29,12 +30,12 @@ protected function setUp(): void */ public function testOriginalEntityDataEmptyWhenProxyLoadedFromTwoAssociations(): void { - /* The key of the problem is that the first phone is fetched via two association, main_phone and phones. + /* The key of the problem is that the first phone is fetched via two association, mainPhone and phones. * * You will notice that the original_entity_datas are not loaded for the first phone. (They are for the second) * - * In the Client entity definition, if you define the main_phone relation after the phones relation, both assertions pass. - * (for the sake or this test, I defined the main_phone relation before the phones relation) + * In the Client entity definition, if you define the mainPhone relation after the phones relation, both assertions pass. + * (for the sake or this test, I defined the mainPhone relation before the phones relation) * */ @@ -156,18 +157,23 @@ class DDC440Client * @GeneratedValue(strategy="AUTO") */ protected $id; + /** + * @var DDC440Phone * @OneToOne(targetEntity="DDC440Phone", fetch="EAGER") * @JoinColumns({ * @JoinColumn(name="main_phone_id", referencedColumnName="id",onDelete="SET NULL") * }) */ - protected $main_phone; + protected $mainPhone; + /** + * @psalm-var Collection * @OneToMany(targetEntity="DDC440Phone", mappedBy="client", cascade={"persist", "remove"}, fetch="EAGER", indexBy="id") * @OrderBy({"number"="ASC"}) */ protected $phones; + /** * @var string * @Column(name="name", type="string") @@ -178,12 +184,12 @@ public function __construct() { } - public function setName($value): void + public function setName(string $value): void { $this->name = $value; } - public function getName() + public function getName(): string { return $this->name; } @@ -194,22 +200,25 @@ public function addPhone(DDC440Phone $value): void $value->setClient($this, false); } - public function getPhones() + /** + * @psalm-return Collection + */ + public function getPhones(): Collection { return $this->phones; } public function setMainPhone(DDC440Phone $value): void { - $this->main_phone = $value; + $this->mainPhone = $value; } - public function getMainPhone() + public function getMainPhone(): DDC440Phone { - return $this->main_phone; + return $this->mainPhone; } - public function getId() + public function getId(): int { return $this->id; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php index 16edc38289..ba75bbaf5e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php @@ -6,6 +6,8 @@ use Doctrine\Tests\OrmFunctionalTestCase; +use function sprintf; + class DDC444Test extends OrmFunctionalTestCase { protected function setUp(): void @@ -30,7 +32,7 @@ public function testExplicitPolicy(): void $this->_em->flush(); $this->_em->clear(); - $q = $this->_em->createQuery("SELECT u FROM $classname u"); + $q = $this->_em->createQuery(sprintf('SELECT u FROM %s u', $classname)); $u = $q->getSingleResult(); $this->assertEquals('Initial value', $u->name); @@ -40,7 +42,7 @@ public function testExplicitPolicy(): void $this->_em->flush(); $this->_em->clear(); - $u = $this->_em->createQuery("SELECT u FROM $classname u"); + $u = $this->_em->createQuery(sprintf('SELECT u FROM %s u', $classname)); $u = $q->getSingleResult(); $this->assertEquals('Initial value', $u->name); @@ -50,7 +52,7 @@ public function testExplicitPolicy(): void // Now we however persisted it, and this should have updated our friend $this->_em->flush(); - $q = $this->_em->createQuery("SELECT u FROM $classname u"); + $q = $this->_em->createQuery(sprintf('SELECT u FROM %s u', $classname)); $u = $q->getSingleResult(); $this->assertEquals('Modified value', $u->name); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php index b1c425291e..b571dc5ed9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php @@ -91,7 +91,7 @@ public function testMergeUnitializedManyToManyAndOneToManyCollections(): void $this->assertHasDeprecationMessages(); } - protected function createAndPersistUser() + protected function createAndPersistUser(): CmsUser { $user = new CmsUser(); $user->name = 'Luka'; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php index 3c2e157e44..fe323ac675 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php @@ -69,6 +69,7 @@ class DDC512Customer * NOTE that we can currently not name the join column the same as the field * (item = item), this currently confuses Doctrine. * + * @var DDC512OfferItem * @OneToOne(targetEntity="DDC512OfferItem", cascade={"remove","persist"}) * @JoinColumn(name="item_id", referencedColumnName="id") */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php index 5c58c82b8f..5dfee8d6ea 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php @@ -103,7 +103,10 @@ class DDC522Customer */ public $id; - /** @Column */ + /** + * @var mixed + * @Column + */ public $name; /** @@ -149,7 +152,10 @@ class DDC522ForeignKeyTest */ public $id; - /** @Column(type="integer", name="cart_id", nullable=true) */ + /** + * @var int + * @Column(type="integer", name="cart_id", nullable=true) + */ public $cartId; /** diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php index 8c55cf51b6..41c83183c8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php @@ -5,6 +5,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Proxy\Proxy; use Doctrine\Tests\OrmFunctionalTestCase; @@ -60,10 +61,14 @@ class DDC531Item */ public $id; - /** @OneToMany(targetEntity="DDC531Item", mappedBy="parent") */ + /** + * @psalm-var Collection + * @OneToMany(targetEntity="DDC531Item", mappedBy="parent") + */ protected $children; /** + * @var DDC531Item * @ManyToOne(targetEntity="DDC531Item", inversedBy="children") * @JoinColumn(name="parentId", referencedColumnName="id") */ @@ -74,12 +79,15 @@ public function __construct() $this->children = new ArrayCollection(); } - public function getParent() + public function getParent(): DDC531Item { return $this->parent; } - public function getChildren() + /** + * @psalm-return Collection + */ + public function getChildren(): Collection { return $this->children; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php index c7b1daf942..ec39f7a4f8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php @@ -79,11 +79,17 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) return $value->value; } + /** + * {@inheritDoc} + */ public function getName() { return self::class; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; @@ -92,14 +98,16 @@ public function requiresSQLCommentHint(AbstractPlatform $platform) class DDC5684ObjectId { + /** @var mixed */ public $value; + /** @param mixed $value */ public function __construct($value) { $this->value = $value; } - public function __toString() + public function __toString(): string { return (string) $this->value; } @@ -112,6 +120,7 @@ public function __toString() class DDC5684Object { /** + * @var DDC5684ObjectIdType * @Id * @Column(type=Doctrine\Tests\ORM\Functional\Ticket\DDC5684ObjectIdType::class) * @GeneratedValue(strategy="AUTO")