Skip to content

Conversation

Kazadri
Copy link

@Kazadri Kazadri commented May 7, 2025

Q A
Branch? 7.3 for features / 6.4, and 7.2 for bug fixes
Bug fix? no
New feature? yes
Deprecations? no
Issues
License MIT

Add BackedEnumVisitor to extract translation key from BackedEnum when the trans contains concatenation with $this->value or $this->name

@Kazadri Kazadri requested a review from welcoMattic as a code owner May 7, 2025 13:14
@welcoMattic welcoMattic force-pushed the translation/improve-php-ast-extractor branch from b4127b2 to 1733c40 Compare May 9, 2025 12:58
@Kazadri Kazadri force-pushed the translation/add-backed-enum-visitor branch from 99d2304 to 2ee7a08 Compare May 9, 2025 13:25
welcoMattic pushed a commit that referenced this pull request May 28, 2025
… not throw exception (lyrixx)

This PR was merged into the 5.4 branch.

Discussion
----------

[HttpKernel] Ensure `HttpCache::getTraceKey()` does not throw exception

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

We have such logs in our logs. It's in our raw PHP logs. They are not caught by monolog, it's too early

```
[11-Oct-2024 01:23:33 UTC] PHP Fatal error:  Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Invalid method override "__CONSTRUCT". in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php:1234
Stack trace:
#0 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(728): Symfony\Component\HttpFoundation\Request->getMethod()
#1 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(207): Symfony\Component\HttpKernel\HttpCache\HttpCache->getTraceKey()
#2 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/Kernel.php(188): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
#3 /var/www/redirection.io/backend/blue/web/app.php(9): Symfony\Component\HttpKernel\Kernel->handle()
#4 {main}
  thrown in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php on line 1234

```

I managed to reproduced locally.
* Before the patch, without the http_cache, symfony returns a 405
* After the patch, without the http_cache, symfony returns a 405
* Before the patch, with the http_cache, symfony returns a 500, without any information (too early)
* After the patch, with the http_cache, symfony returns a 405

Commits
-------

a2ebbe0 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
@welcoMattic welcoMattic force-pushed the translation/improve-php-ast-extractor branch from fc5e0ad to eea087f Compare June 20, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants