Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.13.0 removes too much code #1585

Closed
greg0ire opened this issue Jun 23, 2023 · 5 comments
Closed

8.13.0 removes too much code #1585

greg0ire opened this issue Jun 23, 2023 · 5 comments
Labels

Comments

@greg0ire
Copy link

Running vendor/bin/phpcbf on doctrine/orm produces the following diff:

diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php
index aebd182d7..131be0fbc 100644
--- a/lib/Doctrine/ORM/Configuration.php
+++ b/lib/Doctrine/ORM/Configuration.php
@@ -210,8 +210,6 @@ public function newDefaultAnnotationDriver($paths = [], $useSimpleAnnotationRead
     /**
      * @deprecated No replacement planned.
      *
-     * Adds a namespace under a certain alias.
-     *
      * @param string $alias
      * @param string $namespace
      *
diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
index c2fb4e99b..d529ce900 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
@@ -314,14 +314,6 @@ static function (string $fieldName) use ($data, $class) {
      * are processed, one after the other. For each chunk of class data only one of the
      * following code paths is executed:
      *
-     * Path A: The data chunk belongs to a joined/associated object and the association
-     *         is collection-valued.
-     * Path B: The data chunk belongs to a joined/associated object and the association
-     *         is single-valued.
-     * Path C: The data chunk belongs to a root result element/object that appears in the topmost
-     *         level of the hydrated result. A typical example are the objects of the type
-     *         specified by the FROM clause in a DQL query.
-     *
      * @param mixed[] $row    The data of the row to process.
      * @param mixed[] $result The result array to fill.
      *
diff --git a/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php b/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
index 737d611a3..62a0ba1fb 100644
--- a/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
+++ b/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
@@ -7,7 +7,6 @@
 use Doctrine\DBAL\Cache\QueryCacheProfile;
 use Doctrine\DBAL\Connection;
 use Doctrine\DBAL\Result;
-use Doctrine\DBAL\Types\Type;

 /**
  * Base class for SQL statement executors.
diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php
index f66cb82bf..5790a54ad 100644
--- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php
+++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php
@@ -103,7 +103,7 @@ class GH5804Article
      * @Id
      * @Column(type="GH5804Type", length=255)
      * @GeneratedValue(strategy="CUSTOM")
-     * @CustomIdGenerator(class=\Doctrine\Tests\ORM\Functional\Ticket\GH5804Generator::class)
+     * @CustomIdGenerator(class=GH5804Generator::class)
      */
     public $id;

diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTestCase.php b/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTestCase.php
index 8f1cad3c4..f26c4244a 100644
--- a/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTestCase.php
+++ b/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTestCase.php
@@ -399,26 +399,22 @@ class Group
 }
 class UserListener
 {
-    /** @\Doctrine\ORM\Mapping\PrePersist */
     public function customPrePersist(): void
     {
     }

-    /** @\Doctrine\ORM\Mapping\PostPersist */
     public function customPostPersist(): void
     {
     }
 }
 class GroupListener
 {
-    /** @\Doctrine\ORM\Mapping\PrePersist */
     public function prePersist(): void
     {
     }
 }
 class AddressListener
 {
-    /** @\Doctrine\ORM\Mapping\PostPersist */
     public function customPostPersist(): void
     {
     }
diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php
index 3b1a9245b..60cda36fb 100644
--- a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php
+++ b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php
@@ -384,7 +384,8 @@ class DDC1649Two
 {
     /**
      * @var DDC1649One
-     * @Id @ManyToOne(targetEntity="DDC1649One")
+     *      * @Id
+     * @ManyToOne(targetEntity="DDC1649One")
      */
     public $one;
 }

Some of the changes do not seem legit:

  • Removal of comments in lib/Doctrine/ORM/Configuration.php and lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
  • Removal of type mentioned only in @phpstan annotations
  • Removal of phpdoc annotations starting with a \
greg0ire added a commit to greg0ire/doctrine-orm that referenced this issue Jun 23, 2023
I tweaked the code so that it would not fall victim to
slevomat/coding-standard#1585, thus fixing the
phpcs job without losing information or breaking other jobs.
greg0ire added a commit to greg0ire/doctrine-orm that referenced this issue Jun 23, 2023
I tweaked the code so that it would not fall victim to
slevomat/coding-standard#1585 or
slevomat/coding-standard#1586, thus fixing the
phpcs job without losing information or breaking other jobs.
@kukulich
Copy link
Contributor

Removal of phpdoc annotations starting with a \

Fixed in e76dadc

@kukulich
Copy link
Contributor

Removal of type mentioned only in @phpstan annotations

Should be fixed as a part of #1586

@kukulich
Copy link
Contributor

Removal of comments in lib/Doctrine/ORM/Configuration.php and lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php

Fixed in a13c15e

@kukulich kukulich added the Bug label Jun 25, 2023
@greg0ire
Copy link
Author

Thank you 🙏

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants