Skip to content

Commit 9516056

Browse files
Merge branch '7.2' into 7.3
* 7.2: 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 [Form] Keep submitted values when keep_as_list option of collection type is enabled [Form] Fix `keep_as_list` when data is not an array
2 parents fda552e + 40d1c48 commit 9516056

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
@@ -162,7 +162,11 @@ public function getRunner(?object $application): RunnerInterface
162162

163163
if (!$application->getName() || !$console->has($application->getName())) {
164164
$application->setName($_SERVER['argv'][0]);
165-
$console->add($application);
165+
if (method_exists($console, 'addCommand')) {
166+
$console->addCommand($application);
167+
} else {
168+
$console->add($application);
169+
}
166170
}
167171

168172
$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)