Skip to content

Commit 40d1c48

Browse files
Merge branch '6.4' into 7.2
* 6.4: Silence E_DEPRECATED and E_USER_DEPRECATED [HttpCache] Hit the backend only once after waiting for the cache lock fix compatibility with Symfony 7.4
2 parents 91a630d + ef1f03c commit 40d1c48

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

Internal/BasicErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BasicErrorHandler
2020
{
2121
public static function register(bool $debug): void
2222
{
23-
error_reporting(-1);
23+
error_reporting(\E_ALL & ~\E_DEPRECATED & ~\E_USER_DEPRECATED);
2424

2525
if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
2626
ini_set('display_errors', $debug);

Internal/SymfonyErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function register(bool $debug): void
3030
return;
3131
}
3232

33-
error_reporting(-1);
33+
error_reporting(\E_ALL & ~\E_DEPRECATED & ~\E_USER_DEPRECATED);
3434

3535
if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
3636
ini_set('display_errors', $debug);

SymfonyRuntime.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ public function getRunner(?object $application): RunnerInterface
150150

151151
if (!$application->getName() || !$console->has($application->getName())) {
152152
$application->setName($_SERVER['argv'][0]);
153-
$console->add($application);
153+
if (method_exists($console, 'addCommand')) {
154+
$console->addCommand($application);
155+
} else {
156+
$console->add($application);
157+
}
154158
}
155159

156160
$console->setDefaultCommand($application->getName(), true);

Tests/phpt/application.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
});
2626

2727
$app = new Application();
28-
$app->add($command);
28+
if (method_exists($app, 'addCommand')) {
29+
$app->addCommand($command);
30+
} else {
31+
$app->add($command);
32+
}
2933
$app->setDefaultCommand('go', true);
3034

3135
return $app;

Tests/phpt/command_list.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
$command->setName('my_command');
2424

2525
[$cmd, $args] = $runtime->getResolver(require __DIR__.'/command.php')->resolve();
26-
$app->add($cmd(...$args));
26+
if (method_exists($app, 'addCommand')) {
27+
$app->addCommand($cmd(...$args));
28+
} else {
29+
$app->add($cmd(...$args));
30+
}
2731

2832
return $app;
2933
};

0 commit comments

Comments
 (0)