Skip to content

Commit

Permalink
Remove obsolete code (setAccessible(true))
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed May 5, 2024
1 parent 0093bbf commit 85760a1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/Test/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e

// avoid using the same PHP class name for different cases
$p = new \ReflectionProperty($twig, 'templateClassPrefix');
$p->setAccessible(true);
$p->setValue($twig, '__TwigTemplate_'.hash('xxh128', uniqid((string) mt_rand(), true), false).'_');

$deprecations = [];
Expand Down
1 change: 0 additions & 1 deletion tests/Node/Expression/CallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public function customFunction($arg1, $arg2 = 'default', $arg3 = [])
private function getArguments($call, $args)
{
$m = new \ReflectionMethod($call, 'getArguments');
$m->setAccessible(true);

return $m->invokeArgs($call, $args);
}
Expand Down
6 changes: 0 additions & 6 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public function testFilterBodyNodes($input, $expected)
{
$parser = $this->getParser();
$m = new \ReflectionMethod($parser, 'filterBodyNodes');
$m->setAccessible(true);

$this->assertEquals($expected, $m->invoke($parser, $input));
}

Expand Down Expand Up @@ -96,8 +94,6 @@ public function testFilterBodyNodesThrowsException($input)
$parser = $this->getParser();

$m = new \ReflectionMethod($parser, 'filterBodyNodes');
$m->setAccessible(true);

$m->invoke($parser, $input);
}

Expand All @@ -117,7 +113,6 @@ public function testFilterBodyNodesWithBOM($emptyNode)
$parser = $this->getParser();

$m = new \ReflectionMethod($parser, 'filterBodyNodes');
$m->setAccessible(true);
$this->assertNull($m->invoke($parser, new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$emptyNode, 1)));
}

Expand Down Expand Up @@ -181,7 +176,6 @@ protected function getParser()
$parser->setParent(new Node());

$p = new \ReflectionProperty($parser, 'stream');
$p->setAccessible(true);
$p->setValue($parser, new TokenStream([]));

return $parser;
Expand Down
4 changes: 0 additions & 4 deletions tests/Profiler/Dumper/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ protected function getProfile()
];

$p = new \ReflectionProperty($profile, 'profiles');
$p->setAccessible(true);
$p->setValue($profile, $subProfiles);

return $profile;
Expand Down Expand Up @@ -83,18 +82,15 @@ private function generateProfile($name, $duration, $type, $templateName, array $
$profile = new Profile($templateName, $type, $name);

$p = new \ReflectionProperty($profile, 'profiles');
$p->setAccessible(true);
$p->setValue($profile, $subProfiles);

$starts = new \ReflectionProperty($profile, 'starts');
$starts->setAccessible(true);
$starts->setValue($profile, [
'wt' => 0,
'mu' => 0,
'pmu' => 0,
]);
$ends = new \ReflectionProperty($profile, 'ends');
$ends->setAccessible(true);
$ends->setValue($profile, [
'wt' => $duration,
'mu' => 0,
Expand Down

0 comments on commit 85760a1

Please sign in to comment.