omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
262 stars 114 forks source link

Fix depreciations #198

Closed MaximePinot closed 3 years ago

MaximePinot commented 3 years ago

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 : https://github.com/omines/datatables-bundle/issues/175#issuecomment-694849158)

Details :

https://github.com/omines/datatables-bundle/commit/0373fb52dc78a6be52036a8b0a1f320198bf72fa - 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?

https://github.com/omines/datatables-bundle/commit/46d3f9e37e35b6f2925fecef2a7f427043438700 - Fix Symfony\Component\HttpFoundation\InputBag::get depreciation

Use all instead of get to retrieve an array.

https://github.com/omines/datatables-bundle/commit/f341b7a8b63a05f60cdb53145bb0867f8191a062 - 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 :

https://github.com/omines/datatables-bundle/blob/83e57742c16a6c31bb28721fd4a81b3bfe8f27ce/tests/Functional/FunctionalTest.php#L69-L71

curry684 commented 3 years ago

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

Thanks!