Skip to content

Commit d906762

Browse files
committed
PHP 8.3 | ReportWidthTest: fix deprecation notices for ReflectionProperty::setValue()
The `ReflectionProperty::setValue()` method supports three method signatures, two of which are deprecated as of PHP 8.3. This adjusts the call to `ReflectionProperty::setValue()` in the `Core/Config/ReportWidthTest` to pass `null` as the "object" for setting the value of a static property to make the method call cross-version compatible. Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue
1 parent 26df2fc commit d906762

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/Core/Config/ReportWidthTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public static function setStaticProperty($name, $value)
295295
{
296296
$property = new ReflectionProperty('PHP_CodeSniffer\Config', $name);
297297
$property->setAccessible(true);
298-
$property->setValue($value);
298+
$property->setValue(null, $value);
299299
$property->setAccessible(false);
300300

301301
}//end setStaticProperty()

0 commit comments

Comments
 (0)