Skip to content

Commit f130c13

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent b4e7913 commit f130c13

11 files changed

+5
-71
lines changed

Error/ClassNotFoundError.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function __construct(string $message, \Throwable $previous)
2626
'trace' => $previous->getTrace(),
2727
] as $property => $value) {
2828
$refl = new \ReflectionProperty(\Error::class, $property);
29-
$refl->setAccessible(true);
3029
$refl->setValue($this, $value);
3130
}
3231
}

Error/FatalError.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public function __construct(string $message, int $code, array $error, int $trace
7373
] as $property => $value) {
7474
if (null !== $value) {
7575
$refl = new \ReflectionProperty(\Error::class, $property);
76-
$refl->setAccessible(true);
7776
$refl->setValue($this, $value);
7877
}
7978
}

Error/UndefinedFunctionError.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function __construct(string $message, \Throwable $previous)
2626
'trace' => $previous->getTrace(),
2727
] as $property => $value) {
2828
$refl = new \ReflectionProperty(\Error::class, $property);
29-
$refl->setAccessible(true);
3029
$refl->setValue($this, $value);
3130
}
3231
}

Error/UndefinedMethodError.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function __construct(string $message, \Throwable $previous)
2626
'trace' => $previous->getTrace(),
2727
] as $property => $value) {
2828
$refl = new \ReflectionProperty(\Error::class, $property);
29-
$refl->setAccessible(true);
3029
$refl->setValue($this, $value);
3130
}
3231
}

ErrorHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ public function __construct(BufferingLogger $bootstrappingLogger = null, bool $d
185185
$this->setDefaultLogger($bootstrappingLogger);
186186
}
187187
$traceReflector = new \ReflectionProperty(\Exception::class, 'trace');
188-
$traceReflector->setAccessible(true);
189188
$this->configureException = \Closure::bind(static function ($e, $trace, $file = null, $line = null) use ($traceReflector) {
190189
$traceReflector->setValue($e, $trace);
191190
$e->file = $file ?? $e->file;

ErrorRenderer/HtmlErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class HtmlErrorRenderer implements ErrorRendererInterface
4848
*/
4949
public function __construct(bool|callable $debug = false, string $charset = null, string|FileLinkFormatter $fileLinkFormat = null, string $projectDir = null, string|callable $outputBuffer = '', LoggerInterface $logger = null)
5050
{
51-
$this->debug = \is_bool($debug) || $debug instanceof \Closure ? $debug : \Closure::fromCallable($debug);
51+
$this->debug = \is_bool($debug) ? $debug : $debug(...);
5252
$this->charset = $charset ?: (ini_get('default_charset') ?: 'UTF-8');
5353
$this->fileLinkFormat = $fileLinkFormat ?: (ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'));
5454
$this->projectDir = $projectDir;
55-
$this->outputBuffer = \is_string($outputBuffer) || $outputBuffer instanceof \Closure ? $outputBuffer : \Closure::fromCallable($outputBuffer);
55+
$this->outputBuffer = \is_string($outputBuffer) ? $outputBuffer : $outputBuffer(...);
5656
$this->logger = $logger;
5757
}
5858

ErrorRenderer/SerializerErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class SerializerErrorRenderer implements ErrorRendererInterface
3737
public function __construct(SerializerInterface $serializer, string|callable $format, ErrorRendererInterface $fallbackErrorRenderer = null, bool|callable $debug = false)
3838
{
3939
$this->serializer = $serializer;
40-
$this->format = \is_string($format) || $format instanceof \Closure ? $format : \Closure::fromCallable($format);
40+
$this->format = \is_string($format) ? $format : $format(...);
4141
$this->fallbackErrorRenderer = $fallbackErrorRenderer ?? new HtmlErrorRenderer();
42-
$this->debug = \is_bool($debug) || $debug instanceof \Closure ? $debug : \Closure::fromCallable($debug);
42+
$this->debug = \is_bool($debug) ? $debug : $debug(...);
4343
}
4444

4545
/**

Tests/DebugClassLoaderTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public function testIdempotence()
5050
if (\is_array($function) && $function[0] instanceof DebugClassLoader) {
5151
$reflClass = new \ReflectionClass($function[0]);
5252
$reflProp = $reflClass->getProperty('classLoader');
53-
$reflProp->setAccessible(true);
5453

5554
$this->assertNotInstanceOf(DebugClassLoader::class, $reflProp->getValue($function[0]));
5655

@@ -439,9 +438,6 @@ class_exists(Fixtures\FinalConstant\OverrideFinalConstant::class, true);
439438
], $deprecations);
440439
}
441440

442-
/**
443-
* @requires PHP 8.1
444-
*/
445441
public function testOverrideFinalConstant81()
446442
{
447443
$deprecations = [];

Tests/phpt/fatal_with_nested_handlers.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--TEST--
22
Test catching fatal errors when handlers are nested
3-
--SKIPIF--
4-
<?php if (\PHP_VERSION_ID < 80100) echo 'skip' ?>
53
--FILE--
64
<?php
75

Tests/phpt/fatal_with_nested_handlers_pre81.phpt

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.0.2",
19+
"php": ">=8.1",
2020
"psr/log": "^1|^2|^3",
2121
"symfony/var-dumper": "^5.4|^6.0"
2222
},

0 commit comments

Comments
 (0)