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

Replace doctrine's deprecated fetchAll() with the new methods #260

Closed
JarJak opened this issue Feb 25, 2021 · 5 comments · Fixed by #262
Closed

Replace doctrine's deprecated fetchAll() with the new methods #260

JarJak opened this issue Feb 25, 2021 · 5 comments · Fixed by #262
Assignees

Comments

@JarJak
Copy link

JarJak commented Feb 25, 2021

Feature Request

Replace doctrine's deprecated fetchAll() with the new methods.
Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead.

Diff

        $result = $this->connection
            ->executeQuery($sql)
-            ->fetchAll(\PDO::FETCH_COLUMN);
+            ->fetchFirstColumn();
        $result = $qb->execute()
-			->fetchAll(\PDO::FETCH_ASSOC);
+        	->fetchAllAssociative();
        $result = $this->connection
            ->executeQuery($sql)
-            ->fetchColumn();
+            ->fetchOne();
@TomasVotruba
Copy link
Member

We don't plan to add this feature now. There is a similar rule that does inversed work: https://github.com/rectorphp/rector/blob/master/docs/rector_rules_overview.md#methodcalltoanothermethodcallwithargumentsrector

Inversing the flow should do the work. Contribution is welcomed 👍

@TomasVotruba
Copy link
Member

Closing as out of our scope.

@JarJak
Copy link
Author

JarJak commented Mar 16, 2021

@TomasVotruba why? Isn't it a valid feature request?

@TomasVotruba
Copy link
Member

We're open to contribution of this, but our main focus is on delivering of Rector on lower PHP versions. That's where most project suffer, on PHP 7.1 or even 5.6. Having Rector as composer package in 5.6 helps these projects that really suffer from upgrading.

See rectorphp/rector#5780 and rectorphp/rector#5665

@TomasVotruba
Copy link
Member

I'm looking into this as currently upgrading such a project.

@TomasVotruba TomasVotruba transferred this issue from rectorphp/rector Feb 9, 2024
@TomasVotruba TomasVotruba self-assigned this Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants