Skip to content

Commit e2fdc70

Browse files
Merge pull request #669 from alexislefebvre/chore-remove-compatibility-layers-for-Symfony-3-and-4
chore: remove compatibility layers for Symfony 3 and 4
2 parents ca866e5 + 8d9349e commit e2fdc70

File tree

4 files changed

+16
-100
lines changed

4 files changed

+16
-100
lines changed

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
"symfony/yaml": "^5.4 || ^6.4 || ^7.0 || ^8.0",
3838
"twig/twig": "^2.0 || ^3.8"
3939
},
40-
"conflict": {
41-
"symfony/framework-bundle": "4.3.0"
42-
},
4340
"suggest": {
4441
"doctrine/annotations": "Required to use the @QueryCount(…) annotation",
4542
"liip/test-fixtures-bundle": "Efficient loading of Doctrine fixtures in functional test-cases for Symfony applications"

src/QueryCountClient.php

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,29 @@
1313

1414
namespace Liip\FunctionalTestBundle;
1515

16-
use Symfony\Bundle\FrameworkBundle\Client;
17-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass;
1816
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
19-
20-
// Symfony <4 BC
21-
if (class_exists(CompilerDebugDumpPass::class)) {
22-
class_alias(QueryCountClientSymfony3Trait::class, QueryCountClientTrait::class);
23-
}
24-
25-
// Symfony <4.3.1 BC
26-
if (!class_exists(KernelBrowser::class)) {
27-
class_alias(Client::class, KernelBrowser::class);
28-
}
29-
30-
if (!class_exists(Client::class)) {
31-
class_alias(KernelBrowser::class, Client::class);
32-
}
17+
use Symfony\Component\DomCrawler\Crawler;
3318

3419
class QueryCountClient extends KernelBrowser
3520
{
36-
/*
37-
* We use trait only because of Client::request signature strict type mismatch between Symfony 3 and 4.
38-
*/
39-
use QueryCountClientTrait;
40-
4121
/** @var QueryCounter */
4222
private $queryCounter;
4323

24+
public function request(
25+
string $method,
26+
string $uri,
27+
array $parameters = [],
28+
array $files = [],
29+
array $server = [],
30+
?string $content = null,
31+
bool $changeHistory = true
32+
): Crawler {
33+
$crawler = parent::request($method, $uri, $parameters, $files, $server, $content, $changeHistory);
34+
$this->checkQueryCount();
35+
36+
return $crawler;
37+
}
38+
4439
public function setQueryCounter(QueryCounter $queryCounter): void
4540
{
4641
$this->queryCounter = $queryCounter;

src/QueryCountClientSymfony3Trait.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/QueryCountClientTrait.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)