Skip to content

Commit 0011e8a

Browse files
authored
Merge pull request #672 from PHPCSStandards/feature/configdoubletest-fix-logic-error
ConfigDoubleTest::setStaticConfigProperty(): fix logic error
2 parents 028012a + ad05198 commit 0011e8a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tests/TestUtils/ConfigDouble/ConfigDoubleTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ private function getStaticConfigProperty($name, $config = null)
324324
*/
325325
public static function setStaticConfigProperty($name, $value)
326326
{
327-
$property = new ReflectionProperty('PHP_CodeSniffer\Config', $name);
328-
$property->setAccessible(true);
329-
330327
// The `overriddenDefaults` property is no longer static on PHPCS 4.0+, so ignore it.
331-
if ($name !== 'overriddenDefaults' && \version_compare(Helper::getVersion(), '3.99.99', '<=')) {
332-
$property->setValue(null, $value);
328+
if ($name === 'overriddenDefaults' && \version_compare(Helper::getVersion(), '3.99.99', '>')) {
329+
return;
333330
}
334331

332+
$property = new ReflectionProperty('PHP_CodeSniffer\Config', $name);
333+
$property->setAccessible(true);
334+
$property->setValue(null, $value);
335335
$property->setAccessible(false);
336336
}
337337
}

0 commit comments

Comments
 (0)