8000 bug #47086 Workaround disabled "var_dump" (nicolas-grekas) · symfony/symfony@9a4d7df · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a4d7df

Browse files
bug #47086 Workaround disabled "var_dump" (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- Workaround disabled "var_dump" | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #46881 | License | MIT | Doc PR | - Commits ------- 5e80717 Workaround disabled "var_dump"
2 parents 6c9b6ec + 5e80717 commit 9a4d7df

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function shutdown()
196196
if (class_exists(DebugClassLoader::class, false)) {
197197
DebugClassLoader::checkClasses();
198198
}
199-
$currErrorHandler = set_error_handler('var_dump');
199+
$currErrorHandler = set_error_handler('is_int');
200200
restore_error_handler();
201201

202202
if ($currErrorHandler !== [$this, 'handleError']) {

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public function screamAt($levels, $replace = false)
355355
private function reRegister(int $prev)
356356
{
357357
if ($prev !== $this->thrownErrors | $this->loggedErrors) {
358-
$handler = set_error_handler('var_dump');
358+
$handler = set_error_handler('is_int');
359359
$handler = \is_array($handler) ? $handler[0] : null;
360360
restore_error_handler();
361361
if ($handler === $this) {
@@ -490,7 +490,7 @@ public function handleError($type, $message, $file, $line)
490490
$log = 0;
491491
} else {
492492
if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404)) {
493-
$currentErrorHandler = set_error_handler('var_dump');
493+
$currentErrorHandler = set_error_handler('is_int');
494494
restore_error_handler();
495495
}
496496

@@ -601,7 +601,7 @@ public static function handleFatalError(array $error = null)
601601
$sameHandlerLimit = 10;
602602

603603
while (!\is_array($handler) || !$handler[0] instanceof self) {
604-
$handler = set_exception_handler('var_dump');
604+
$handler = set_exception_handler('is_int');
605605
restore_exception_handler();
606606

607607
if (!$handler) {

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public function screamAt(int $levels, bool $replace = false): int
375375
private function reRegister(int $prev): void
376376
{
377377
if ($prev !== $this->thrownErrors | $this->loggedErrors) {
378-
$handler = set_error_handler('var_dump');
378+
$handler = set_error_handler('is_int');
379379
$handler = \is_array($handler) ? $handler[0] : null;
380380
restore_error_handler();
381381
if ($handler === $this) {
@@ -522,7 +522,7 @@ public function handleError(int $type, string $message, string $file, int $line)
522522
$log = 0;
523523
} else {
524524
if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404)) {
525-
$currentErrorHandler = set_error_handler('var_dump');
525+
$currentErrorHandler = set_error_handler('is_int');
526526
restore_error_handler();
527527
}
528528

@@ -639,7 +639,7 @@ public static function handleFatalError(array $error = null): void
639639
$sameHandlerLimit = 10;
640640

641641
while (!\is_array($handler) || !$handler[0] instanceof self) {
642-
$handler = set_exception_handler('var_dump');
642+
$handler = set_exception_handler('is_int');
643643
restore_exception_handler();
644644

645645
if (!$handler) {

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static function prepareRequest(?string $method, ?string $url, array $opt
106106
}
107107

108108
// Validate on_progress
109-
if (!\is_callable($onProgress = $options['on_progress'] ?? 'var_dump')) {
109+
if (isset($options['on_progress']) && !\is_callable($onProgress = $options['on_progress'])) {
110110
throw new InvalidArgumentException(sprintf('Option "on_progress" must be callable, "%s" given.', \is_object($onProgress) ? \get_class($onProgress) : \gettype($onProgress)));
111111
}
112112

src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DebugHandlersListener implements EventSubscriberInterface
5454
*/
5555
public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $fileLinkFormat = null, bool $scope = true)
5656
{
57-
$handler = set_exception_handler('var_dump');
57+
$handler = set_exception_handler('is_int');
5858
$this->earlyHandler = \is_array($handler) ? $handler[0] : null;
5959
restore_exception_handler();
6060

@@ -80,7 +80,7 @@ public function configure(Event $event = null)
8080
}
8181
$this->firstCall = $this->hasTerminatedWithException = false;
8282

83-
$handler = set_exception_handler('var_dump');
83+
$handler = set_exception_handler('is_int');
8484
$handler = \is_array($handler) ? $handler[0] : null;
8585
restore_exception_handler();
8686

0 commit comments

Comments
 (0)
0