You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When loading a class defined in eval()'d code DebugClassLoader::darwinRealpath() is unable to determine the real path of the file and a notice is triggered by the return $real .= $dirFiles[$kFile]; statement.
Additional context
The KernelTestCase PHPUnit 8 compatibility fix applied in #30124 defines KernelShutdownOnTearDownTrait in an eval() block and breaks the container compilation on mac.
[ErrorException]
Notice: Undefined index: kernelshutdownonteardowntrait.php(19) : eval()'d code
Exception trace:
() at /www/relendex/trading-api/vendor/symfony/debug/DebugClassLoader.php:450
spl_autoload_call() at /www/relendex/trading-api/vendor/symfony/framework-bundle/Test/KernelTestCase.php:26
(The stack trace is from 4.2@dev, but the PR was merged to 3.4).
The text was updated successfully, but these errors were encountered:
…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
…e on Darwin (skalpa)
This PR was squashed before being merged into the 3.4 branch (closes#30363).
Discussion
----------
Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30362
| License | MIT
When a class is defined in an `eval()` block, the reported file name is `file_name.php(123) : eval()'d code`, which prevents `DebugClassLoader::darwinRealpath()` from locating/normalizing the file name, and triggers a notice.
Commits
-------
6c2aa24 Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
Symfony version(s) affected: 3.4
Description
When loading a class defined in eval()'d code
DebugClassLoader::darwinRealpath()
is unable to determine the real path of the file and a notice is triggered by thereturn $real .= $dirFiles[$kFile];
statement.Additional context
The KernelTestCase PHPUnit 8 compatibility fix applied in #30124 defines
KernelShutdownOnTearDownTrait
in aneval()
block and breaks the container compilation on mac.(The stack trace is from 4.2@dev, but the PR was merged to 3.4).
The text was updated successfully, but these errors were encountered: