Skip to content
Permalink
Browse files

minor #30364 [FrameworkBundle] Removed eval() from KernelShutdownOnTe…

…arDownTrait (skalpa)

This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] Removed eval() from KernelShutdownOnTearDownTrait

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Apart from triggering the #30362 bug, the `eval()` block from #30124 also broke my workflow: static code analyzers don't like this, and the trait even crashes PHPStan.

It may also bring up other compatibility issues to other people (ie: I know companies that completely disable `eval()` on their servers).

As it was only required to keep the trait compatible with PHP 5.x, it is unnecessary on 4.x that requires PHP 7.1+, and this PR removes it on the 4.2 branch.

Commits
-------

324b70a Removed eval() from KernelShutdownOnTearDownTrait
  • Loading branch information...
nicolas-grekas committed Feb 24, 2019
2 parents 5b23a2b + 324b70a commit e73f70aca4b88189517b91875099638e93684a5e
Showing with 0 additions and 4 deletions.
  1. +0 −4 src/Symfony/Bundle/FrameworkBundle/Test/KernelShutdownOnTearDownTrait.php
@@ -16,9 +16,6 @@
// Auto-adapt to PHPUnit 8 that added a `void` return-type to the tearDown method
if (method_exists(\ReflectionMethod::class, 'hasReturnType') && (new \ReflectionMethod(TestCase::class, 'tearDown'))->hasReturnType()) {
eval('
namespace Symfony\Bundle\FrameworkBundle\Test;
/**
* @internal
*/
@@ -29,7 +26,6 @@ protected function tearDown(): void
static::ensureKernelShutdown();
}
}
');
} else {
/**
* @internal

0 comments on commit e73f70a

Please sign in to comment.
You can’t perform that action at this time.