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

Fix depreciations #198

Merged
merged 3 commits into from
Nov 25, 2020
Merged

Fix depreciations #198

merged 3 commits into from
Nov 25, 2020

Conversation

MaximePinot
Copy link
Contributor

This PR aims at fixing depreciations.

Each fixed depreciation is in a single commit so you can cherry pick them if you disagree with some changes (I'm thinking of the removal of EntityManager::detach : #175 (comment))

Details :

0373fb5 - Fix Doctrine\ORM\EntityManager::detach depreciation

Should we replace $this->manager->detach($result); by $this->manager->clear();? See this.
Or should the user use the array hydratation mode in case of memory issues?

46d3f9e - Fix Symfony\Component\HttpFoundation\InputBag::get depreciation

Use all instead of get to retrieve an array.

f341b7a - Fix Symfony\Component\HttpFoundation\JsonResponse::create depreciation

Use the constructor instead.

There are two depreciations remaining :

Warning: Your XML configuration validates against a deprecated schema.
Suggestion: Migrate your XML configuration using "--migrate-configuration"!

I don't think it is possible to migrate now as this bundle supports PHPUnit 8.5.

  1. Tests\Functional\FunctionalTest::testPlainDataTable
    assertRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertMatchesRegularExpression() instead.

Already aware of it :

// Change when we drop old PHP versions and thus old PHPunit versions
$this->assertRegExp('#href="/employee/[0-9]+"#', $sample->buttons);
//$this->assertMatchesRegularExpression('#href="/employee/[0-9]+"#', $sample->buttons);

@@ -114,7 +114,6 @@ public function getResults(AdapterQuery $query): \Traversable

foreach ($paginator->getIterator() as $result) {
yield $result;
$this->manager->detach($result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can replace detach by clear() ? to prevent PHP blows up see #175

@curry684
Copy link
Member

I'll just bite the bullet and merge all - it's not like Doctrine will ever 'fix' the detach challenge on their end.

Thanks!

@curry684 curry684 merged commit 5ccdc12 into omines:master Nov 25, 2020
curry684 added a commit that referenced this pull request Jan 20, 2021
curry684 pushed a commit that referenced this pull request Jan 20, 2021
* Fix Doctrine\ORM\EntityManager::detach depreciation

* Fix Symfony\Component\HttpFoundation\InputBag::get depreciation

* Fix Symfony\Component\HttpFoundation\JsonResponse::create depreciation

(cherry picked from commit 5ccdc12)
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 this pull request may close these issues.

3 participants