Skip to content

Commit

Permalink
Removed redundant Reflection*#setAccessible() calls
Browse files Browse the repository at this point in the history
These are no longer needed as per PHP 8.1 and newer.
  • Loading branch information
Ocramius committed Dec 22, 2022
1 parent e2d00ab commit a6fca4c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/Roave/InfectionStaticAnalysis/Bootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public static function bootstrap(
);
};

/** @infection-ignore-all */
$reflectionOffsetSet->setAccessible(true);
$reflectionOffsetSet->invokeArgs($container, [MutantExecutionResultFactory::class, $factory]);

return $container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public function __construct(
) {
$this->reflectionOriginalStartFileLocation = new ReflectionProperty(MutantExecutionResult::class, 'originalStartFilePosition');
$this->reflectionOriginalEndFilePosition = new ReflectionProperty(MutantExecutionResult::class, 'originalEndFilePosition');

$this->reflectionOriginalStartFileLocation->setAccessible(true);
$this->reflectionOriginalEndFilePosition->setAccessible(true);
}

public function createFromProcess(MutantProcess $mutantProcess): MutantExecutionResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ public function testWillKillMutantsThatEscapedAndFailedStaticAnalysis(): void
$reflectionOriginalStartFileLocation = new ReflectionProperty(MutantExecutionResult::class, 'originalStartFilePosition');
$reflectionOriginalEndFilePosition = new ReflectionProperty(MutantExecutionResult::class, 'originalEndFilePosition');

$reflectionOriginalStartFileLocation->setAccessible(true);
$reflectionOriginalEndFilePosition->setAccessible(true);

self::assertSame(2, $reflectionOriginalStartFileLocation->getValue($nextFactoryResult));
self::assertSame(8, $reflectionOriginalEndFilePosition->getValue($nextFactoryResult));
}
Expand Down

0 comments on commit a6fca4c

Please sign in to comment.