Skip to content

Commit

Permalink
minor #30364 [FrameworkBundle] Removed eval() from KernelShutdownOnTe…
Browse files Browse the repository at this point in the history
…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 e73f70a
Showing 1 changed file with 0 additions and 4 deletions.
Expand Up @@ -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
*/
Expand All @@ -29,7 +26,6 @@ protected function tearDown(): void
static::ensureKernelShutdown();
}
}
');
} else {
/**
* @internal
Expand Down

0 comments on commit e73f70a

Please sign in to comment.