-
Notifications
You must be signed in to change notification settings - Fork 0
Created ArgumentResolverInterface #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* | ||
* @return mixed The resolved argument | ||
*/ | ||
public function resolve(\ReflectionParameter $parameter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ReflectionParameter is exactly what you need here, but depending directly on reflection seems a bit off to me. It's very powerful and can be abused. Next to that, the documentation on php.net is minimal. Is perhaps an idea to wrap something around it like with the ParamConverterInterface? Might be a bit easier to unit-test that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Minimal docs on php.net should not block a developer. The functions are really clear about what they do.
- When unit testing, you need to use a mock for this. It won't make a difference which class you use.
- Abusing is the only valid point, but well. Creating a wrapper class just to make our code more noobproof is a -1 from me. After all, you can't really do bad things.
Created ArgumentResolverInterface
…webmozart) This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes symfony#11998). Discussion ---------- [Intl] Integrated ICU data into Intl component #2 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Follow-up PR to symfony#11920. This PR contains generated data files only. Commits ------- 65a8b9f [Intl] Generated the data for ICU version 54-rc
This PR was merged into the 2.6-dev branch. Discussion ---------- [VarDumper] Dynamic HTML dumper | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#12109 | License | MIT | Doc PR | - This PR partially reverts symfony#12109 because it didn't take into account that many dumps can share a single style tag. More importantly, this PR enhance dump rendering with some cute JS navigation effects: - references highlighting on hovering - moving references toggling Here is a screenshot (note the yellow background and the fact that `#2` appears after the first `@2`):  Commits ------- b799844 [VarDumper] Dynamic HTML dumper
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes symfony#12453). Discussion ---------- [Debug] Show only unique class candidates | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ``` PHPUnit 4.3.5 by Sebastian Bergmann. Configuration read from .../symfony/phpunit.xml.dist S....S.............................FFFS....... Time: 2.29 seconds, Memory: 8.50Mb There were 3 failures: 1) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #2 (array(1, 12, 'foo.php', 'Class \'UndefinedFunctionException\' not found'), 'Attempted to load class "UndefinedFunctionException" from the global namespace. Did you forget a "use" statement for "Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException"?') Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ Attempted to load class "UndefinedFunctionException" from the global namespace. -Did you forget a "use" statement for "Symfony\Component\Debug\Exception\UndefinedFunctionException"? +Did you forget a "use" statement for e.g. "Symfony\Component\Debug\Exception\UndefinedFunctionException" or "Symfony\Component\Debug\Exception\UndefinedFunctionException"? .../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28 2) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #3 (array(1, 12, 'foo.php', 'Class \'PEARClass\' not found'), 'Attempted to load class "PEARClass" from the global namespace. Did you forget a "use" statement for "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?') Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ Attempted to load class "PEARClass" from the global 8000 namespace. -Did you forget a "use" statement for "Symfony_Component_Debug_Tests_Fixtures_PEARClass"? +Did you forget a "use" statement for e.g. "Symfony_Component_Debug_Tests_Fixtures_PEARClass" or "Symfony_Component_Debug_Tests_Fixtures_PEARClass"? .../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28 3) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #4 (array(1, 12, 'foo.php', 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found'), 'Attempted to load class "UndefinedFunctionException" from namespace "Foo\\Bar". Did you forget a "use" statement for "Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException"?') Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ Attempted to load class "UndefinedFunctionException" from namespace "Foo\Bar". -Did you forget a "use" statement for "Symfony\Component\Debug\Exception\UndefinedFunctionException"? +Did you forget a "use" statement for e.g. "Symfony\Component\Debug\Exception\UndefinedFunctionException" or "Symfony\Component\Debug\Exception\UndefinedFunctionException"? .../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28 ``` Commits ------- db8a3ae [Debug] Show only unique class candidates
Add comment as requested - see comment for stof
…owlan) This PR was merged into the 2.3 branch. Discussion ---------- [Yaml] Improve YAML boolean escaping | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#13209 | License | MIT | Doc PR | None This PR ensures that PHP [values which would be interpreted as booleans][1] in older versions of the YAML spec are escaped with single quotes when dumped by the Dumper. For example, dumping this: ```php array( 'country_code' => 'no', 'speaks_norwegian' => 'y', 'heating' => 'on', ) ``` Will produce this YAML: ```yaml country_code: 'no' speaks_norwegian: 'y' heating: 'on' ``` [1]: http://yaml.org/type/bool.html Commits ------- 8fa056b Inline private 'is quoting required' methods in Escaper afe827a Merge pull request #2 from larowlan/patch-2 a0ec0fe Add comment as requested 1e0633e Merge pull request #1 from larowlan/patch-1 81a8090 Remove duplicate 'require' 3760e67 [Yaml] Improve YAML boolean escaping
…eprecation on-demand (nicolas-grekas) This PR was merged into the 2.8 branch. Discussion ---------- [Bridge\PhpUnit] Display the stack trace of a deprecation on-demand | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR has been essential into making symfony#16708, and I think everyone working on a 3.0 migration will need this. Example: ``` $ SYMFONY_DEPRECATIONS_HELPER=/FormExtensionBootstrap3LayoutTest/ ./phpunit src/Symfony/Bridge/Twig/ PHPUnit 4.8.18 by Sebastian Bergmann and contributors. Testing src/Symfony/Bridge/Twig/ ................................................ Remaining deprecation triggered by Symfony\Bridge\Twig\Tests\Extension\FormExtensionBootstrap3LayoutTest::testSingleChoiceGrouped: The value "false" for the "choices_as_values" option is deprecated since version 2.8 and will not be supported anymore in 3.0. Set this option to "true" and flip the contents of the "choices" option instead. Stack trace: #0 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php(286): trigger_error() #1 src/Symfony/Component/OptionsResolver/OptionsResolver.php(962): Symfony\Component\Form\Extension\Core\Type\ChoiceType->Symfony\Component\Form\Extension\Core\Type\{closure}() #2 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php(277): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet() #3 src/Symfony/Component/OptionsResolver/OptionsResolver.php(962): Symfony\Component\Form\Extension\Core\Type\ChoiceType->Symfony\Component\Form\Extension\Core\Type\{closure}() #4 src/Symfony/Component/OptionsResolver/OptionsResolver.php(791): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet() symfony#5 src/Symfony/Component/Form/ResolvedFormType.php(156): Symfony\Component\OptionsResolver\OptionsResolver->resolve() symfony#6 src/Symfony/Component/Form/FormFactory.php(119): Symfony\Component\Form\ResolvedFormType->createBuilder() symfony#7 src/Symfony/Component/Form/FormFactory.php(48): Symfony\Component\Form\FormFactory->createNamedBuilder() symfony#8 src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php(540): Symfony\Component\Form\FormFactory->createNamed() symfony#9 [internal function]: Symfony\Com 8000 ponent\Form\Tests\AbstractBootstrap3LayoutTest->testSingleChoiceGrouped() symfony#10 {main} KO src/Symfony/Bridge/Twig/ ``` Commits ------- 5a88fb6 [Bridge\PhpUnit] Display the stack trace of a deprecation on-demand
[Serializer] Use $context['cache_key'] to enhance caching
…ble data (dunglas, nicolas-grekas) This PR was merged into the 2.8 branch. Discussion ---------- [Serializer] Allow context to contain not serializable data | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Allow the context to contain not serializable data even for the `ObjectNormalizer` (BC break fix). Commits ------- 996f69d Merge pull request #2 from nicolas-grekas/ser-cache 8560c13 [Serializer] Use $context['cache_key'] to enhance caching c1740fc [Serializer] ObjectNormalizer: context can contain not serializable data
…logs (fabpot) This PR was merged into the 4.3-dev branch. Discussion ---------- [Messenger] Add missing information in messenger logs | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes-ish | New feature? | yes-ish | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a When using `messenger:consume`, I get the following logs: ``` 2019-03-25T11:39:05+01:00 [info] Received message "Symfony\Component\Mailer\EnvelopedMessage" 2019-03-25T11:39:05+01:00 [warning] An exception occurred while handling message "Symfony\Component\Mailer\EnvelopedMessage" 2019-03-25T11:39:05+01:00 [info] Retrying Symfony\Component\Mailer\EnvelopedMessage - retry #1. 2019-03-25T11:39:05+01:00 [info] Sending message "Symfony\Component\Mailer\EnvelopedMessage" with "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport" 2019-03-25T11:39:06+01:00 [info] Received message "Symfony\Component\Mailer\EnvelopedMessage" 2019-03-25T11:39:06+01:00 [warning] An exception occurred while handling message "Symfony\Component\Mailer\EnvelopedMessage" 2019-03-25T11:39:06+01:00 [info] Retrying Symfony\Component\Mailer\EnvelopedMessage - retry #2. 2019-03-25T11:39:06+01:00 [info] Sending message "Symfony\Component\Mailer\EnvelopedMessage" with "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport" 2019-03-25T11:39:09+01:00 [info] Received message "Symfony\Component\Mailer\EnvelopedMessage" 2019-03-25T11:39:09+01:00 [warning] An exception occurred while handling message "Symfony\Component\Mailer\EnvelopedMessage" 2019-03-25T11:39:09+01:00 [info] Retrying Symfony\Component\Mailer\EnvelopedMessage - retry #3. 2019-03-25T11:39:09+01:00 [info] Sending message "Symfony\Component\Mailer\EnvelopedMessage" with "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport" ``` So, an. error occurred, but I have no idea what's going on. The exception is in the context, but the context is not displayed by default. So, this PR fixes it. Commits ------- 20664ca [Messenger] added missing information in messenger logs
… is empty (yceruto) This PR was merged into the 4.2 branch. Discussion ---------- [HttpKernel] Fix get session when the request stack is empty | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT This bug happen behind an exception on a kernel response event, when one collector (e.g. `RequestDataCollector`) is trying to get the request session and the request stack is currently empty. **Reproducer** https://github.com/yceruto/get-session-bug (`GET /`) See logs on terminal: ```bash Apr 15 20:29:03 |ERROR| PHP 2019-04-15T20:29:03-04:00 Call to a member function isSecure() on null Apr 15 20:29:03 |ERROR| PHP PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function isSecure() on null in /home/yceruto/demos/getsession/vendor/symfony/http-kernel/EventListener/SessionListener.php:43 Apr 15 20:29:03 |DEBUG| PHP Stack trace: Apr 15 20:29:03 |DEBUG| PHP #0 /home/yceruto/demos/getsession/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php(59): Symfony\Component\HttpKernel\EventListener\SessionListener->getSession() Apr 15 20:29:03 |DEBUG| PHP #1 /home/yceruto/demos/getsession/vendor/symfony/http-foundation/Request.php(707): Symfony\Component\HttpKernel\EventListener\AbstractSessionListener->Symfony\Component\HttpKernel\EventListener\{closure}() Apr 15 20:29:03 |DEBUG| PHP #2 /home/yceruto/demos/getsession/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php(65): Symfony\Component\HttpFoundation\Request->getSession() Apr 15 20:29:03 |DEBUG| PHP #3 /home/yceruto/demos/getsession/vendor/symfony/http-kernel/Profiler/Profiler.php(167): Symfony\Component\HttpKernel\DataCollector\RequestDataCollector->collect(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Respo in /home/yceruto/demos/getsession/vendor/symfony/http-kernel/EventListener/SessionListener.php on line 43 ``` Friendly ping @nicolas-grekas as author of the previous PR symfony#28244 Commits ------- d62ca37 Fix get session when the request stack is empty
…dmaicher) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] conflict with VarDumper < 4.4 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - While trying FrameworkBundle 4.4.x-dev I noticed that I was still using VarDumper 4.3 which leads to this error: ``` > app/console cache:clear Fatal error: Uncaught Symfony\Component\ErrorHandler\Exception\ClassNotFoundException: Attempted to load class "ContextualizedDumper" from namespace "Symfony\Component\VarDumper\Dumper". Did you forget a "use" statement for another namespace? in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php:13 Stack trace: #0 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(1357): require() #1 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(2282): ContainerB7mbdCh\appAppKernelDevDebugContainer->load('getDebug_DumpLi...') #2 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(275): ContainerB7mbdCh\appAppKernelDevDebugContainer->ContainerB7mbdCh\{closure}() #3 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(90): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.command') #4 /var/www/x in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php on line 13 PHP Fatal error: Uncaught Symfony\Component\ErrorHandler\Exception\ClassNotFoundException: Attempted to load class "ContextualizedDumper" from namespace "Symfony\Component\VarDumper\Dumper". Did you forget a "use" statement for another namespace? in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php:13 Stack trace: #0 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(1357): require() #1 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(2282): ContainerB7mbdCh\appAppKernelDevDebugContainer->load('getDebug_DumpLi...') #2 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(275): ContainerB7mbdCh\appAppKernelDevDebugContainer->ContainerB7mbdCh\{closure}() #3 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(90): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.command') #4 /var/www/x in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php on line 13 Script app/console cache:clear handling the post-update-cmd event returned with error code 255 ``` So we need to use `symfony/var-dumper >= 4.4` Commits ------- 9b512c6 [FrameworkBundle] conflict with VarDumper < 4.4
…tack() (dunglas) This PR was merged into the 5.1 branch. Discussion ---------- [DI] Fix call to sprintf in ServicesConfigurator::stack() | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT | Doc PR | n/a This PR fixes a faulty call to `sprintf()` and prevents the following error: ``` Warning: sprintf(): Too few arguments in /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php on l 10000 ine 154 Fatal error: Uncaught Error: Wrong parameters for Symfony\Component\DependencyInjection\Exception\InvalidArgumentException([string $message [, long $code [, Throwable $previous = NULL]]]) in /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php:154 Stack trace: #0 /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php(154): Exception->__construct('', 1, 'api_platform.js...') #1 /Users/dunglas/workspace/activity-pub/src/Bundle/Resources/config/services.php(12): Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator->stack('api_platform.js...', Array) #2 /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php(50): Symfony\Component\DependencyInjection\Loader\ProtectedPhpFileLoader::Symfony\Component\DependencyInjection\Loader\Configurator\{closure}(Object(Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurat in /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php on line 154 ``` Commits ------- 11da9d3 [DI] Fix call to sprintf in ServicesConfigurator::stack()
This PR was merged into the 5.3-dev branch. Discussion ---------- [Security] Added debug:firewall command | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix symfony#39321 | License | MIT | Doc PR | symfony/symfony-docs#14982 | Tags | #SymfonyHackday ### Subtasks - [x] Add list view (for use without arguments) - [x] Add more information to list view - [x] Add detail view (for use with `firewall` argument) - [x] Add more information to detail view table - [x] Add authenticators list - [x] Add event listeners & events (copy from `debug:event-listener`) - [x] Add `--include-listeners` option (default: false) - [x] Add helptext - [x] Add documentation ### Moved outside of current scope - Add allowed badges ### Usage (and example output) for a list `bin/console debug:firewall` ``` Firewalls ========= The following firewalls are defined: -------- Name -------- dev public main -------- // To view details of a specific firewall, re-run this command with a firewall name. (e.g. debug:firewall // main) ``` ### Usage (and example output) for details `bin/console debug:firewall main` ``` Firewall "main" =============== ----------------------- --------------------------------------------------- Option Value ----------------------- --------------------------------------------------- Name main Context main Lazy Yes Stateless No User Checker security.user_checker Provider security.user.provider.concrete.app_user_provider Entry Point App\Security\LoginFormAuthenticator Access Denied URL Access Denied Handler ----------------------- --------------------------------------------------- User switching -------------- ----------- --------------------------------------------------- Option Value ----------- --------------------------------------------------- Parameter test Provider security.user.provider.concrete.app_user_provider User Role ROLE_SWITCH_POSSIBLE ----------- --------------------------------------------------- Event listeners for firewall "main" =================================== "Symfony\Component\Security\Http\Event\LoginSuccessEvent" event --------------------------------------------------------------- ------- -------------------------------------------------------------------------------------------- ---------- Order Callable Priority ------- -------------------------------------------------------------------------------------------- ---------- #1 Symfony\Component\Security\Http\EventListener\UserCheckerListener::postCheckCredentials() 256 #2 Symfony\Component\Security\Http\EventListener\SessionStrategyListener::onSuccessfulLogin() 0 #3 Symfony\Component\Security\Http\EventListener\RememberMeListener::onSuccessfulLogin() 0 #4 App\Security\UpdateLastLogin::__invoke() 0 symfony#5 Symfony\Component\Security\Http\EventListener\PasswordMigratingListener::onLoginSuccess() 0 ------- -------------------------------------------------------------------------------------------- ---------- "Symfony\Component\Security\Http\Event\LogoutEvent" event --------------------------------------------------------- ------- ------------------------------------------------------------------------------------------- ---------- Order Callable Priority ------- ------------------------------------------------------------------------------------------- ---------- #1 Symfony\Component\Security\Http\EventListener\DefaultLogoutListener::onLogout() 64 #2 Symfony\Component\Security\Http\EventListener\SessionLogoutListener::onLogout() 0 #3 Symfony\Component\Security\Http\EventListener\RememberMeLogoutListener::onLogout() 0 #4 Symfony\Component\Security\Http\EventListener\CsrfTokenClearingLogoutListener::onLogout() 0 ------- ------------------------------------------------------------------------------------------- ---------- "Symfony\Component\Security\Http\Event\CheckPassportEvent" event ---------------------------------------------------------------- ------- ------------------------------------------------------------------------------------------ ---------- Order Callable Priority ------- ------------------------------------------------------------------------------------------ ---------- #1 Symfony\Component\Security\Http\EventListener\LoginThrottlingListener::checkPassport() 2080 #2 Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport() 2048 #3 Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport() 1024 #4 Symfony\Component\Security\Http\EventListener\CsrfProtectionListener::checkPassport() 512 symfony#5 Symfony\Component\Security\Http\EventListener\UserCheckerListener::preCheckCredentials() 256 symfony#6 App\Security\DisallowBannedUsers::__invoke() 0 symfony#7 Symfony\Component\Security\Http\EventListener\CheckCredentialsListener::checkPassport() 0 ------- ------------------------------------------------------------------------------------------ ---------- "Symfony\Component\Security\Http\Event\LoginFailureEvent" event --------------------------------------------------------------- ------- ----------------------------------------------------------------------------------- ---------- Order Callable Priority ------- ----------------------------------------------------------------------------------- ---------- #1 Symfony\Component\Security\Http\EventListener\RememberMeListener::onFailedLogin() 0 ------- ----------------------------------------------------------------------------------- ---------- Authenticators for firewall "main" ================================== // @todo: List authenticator information ``` Commits ------- a9dea1d [Security] Added debug:firewall command
…e (Plopix) This PR was merged into the 4.4 branch. Discussion ---------- RequestMatcher issue when `_controller` is a closure | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT ## Description If the `matches` method of `RequestMatcher` is used on an attribute which is a closure it crashes. ## How did we get it On a project that is using FOS HTTP Cache, we have this configuration ```yaml fos_http_cache: cache_control: rules: - match: attributes: { _controller: ^App\\Controller\\.*::.* } headers: overwrite: true cache_control: { public: true, private: false, must_revalidate: true, s_maxage: 3600 } ``` Everything works fine unless you are reaching a controller that is a closure. You get a ```TypeError: preg_match(): Argument #2 ($subject) must be of type string, Closure given``` which is to me logical. ## Proposed solution Just testing the type of attribute value and return false before crashing `preg_match` This PR adds a quick unit test to enforce this. Commits ------- 6649123 Fix issue with RequestMatcher when attribute is a closure
…h case insensitive (javiereguiluz) This PR was merged into the 5.3-dev branch. Discussion ---------- [FrameworkBundle] Make debug:event-dispatcher search case insensitive | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I was playing with the new features of `debug:event-dispatcher` and I thought that making the new search feature case insensitive could be better: ### Before ``` $ php bin/console debug:event-dispatcher mailer [WARNING] The event "mailer" does not have any registered listeners. ``` ### After ``` $ php bin/console debug:event-dispatcher mailer Registered Listeners of Event Dispatcher "debug.event_dispatcher" for "Symfony\Component\Mailer\Event\MessageEvent" Event ========================================================================================================================= ------- --------------------------------------------------------------------------- ---------- Order Callable Priority ------- --------------------------------------------------------------------------- ---------- #1 Symfony\Component\Mailer\EventListener\MessageListener::onMessage() 0 #2 Symfony\Component\Mailer\EventListener\EnvelopeListener::onMessage() -255 #3 Symfony\Component\Mailer\EventListener\MessageLoggerListener::onMessage() -255 ------- --------------------------------------------------------------------------- ---------- ``` Commits ------- 1e4c7d9 [FrameworkBundle] Make debug:event-dispatcher search case insensitive
DOMElement::setAttribute(): Passing null to parameter #2 ($value) of type string is deprecated This happens when a tag value is `null` on PHP 8.1.
…tring (ruudk) This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] Cast tag attribute value to string | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? |no | Deprecations? |no | Tickets | | License | MIT | Doc PR | ``` DOMElement::setAttribute(): Passing null to parameter #2 ($value) of type string is deprecated ``` This happens when a tag value is `null` on PHP 8.1. Commits ------- 8fe5fce [DependencyInjection] Cast tag value to string
…tations (sormes) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Validator] Error using CssColor with doctrine annotations | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | none | License | MIT When use doctrine annotations and set formats parameter throw and error `array_merge(): Argument #2 must be of type array, null given` `in vendor/symfony/validator/Constraints/CssColor.php (line 75) ` Commits ------- bba6e15 [Validator] Error using CssColor with doctrine annotations
… resource (Seldaek) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Process] Avoid calling fclose on an already closed resource | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> I got this in Composer while interrupting an install process with Ctrl-C. ``` PHP Fatal error: Uncaught TypeError: fclose(): supplied resource is not a valid stream resource in /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php:50 Stack trace: #0 /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php(50): fclose() #1 /var/www/composer/vendor/symfony/process/Pipes/UnixPipes.php(50): Symfony\Component\Process\Pipes\AbstractPipes->close() #2 [internal function]: Symfony\Component\Process\Pipes\UnixPipes->__destruct() #3 {main} thrown in /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php on line 50 ``` I am assuming it's due to a process which was not closed properly, which is very likely given we run a bunch of them concurrently.. It's pretty hard to debug as it's also hard to reproduce, so I am not sure what to do except handle this case gracefully in the close/__destruct function and hope that at least lets it clean up processes without crashing this way. Commits ------- a9e43a7 [Process] Avoid calling fclose on an already closed resource
…usse) This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] Handle requests with null body | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | / | License | MIT | Doc PR | / since symfony#45527 passing null to the `body` parameters leads to an exception (which [breaks async-aws](https://github.com/async-aws/aws/blob/09723ddca29b8d1d522426f81dd422373de1785f/src/Core/src/AbstractApi.php#L157)) > Argument #2 ($body) must be of type Closure, null given, called in /home/runner/work/aws/aws/vendor/symfony/http-client/CurlHttpClient.php on line 221 In curl client: `null` is not a string and `self::readRequestBody` expects a closure. https://github.com/symfony/symfony/blob/08fa74a16c84895575e305b2a7ee3a03e371f79b/src/Symfony/Component/HttpClient/CurlHttpClient.php#L214-L221 In NativeClient, `getBodyAsString` will fail to return `null` because of the `string` return type. Before symfony#45527 null was converted to `""` thanks to the defaultOptions, but this is not the case anymore. In many places, we check if the body is `!== ""` but rarely check if the body is null, this PR restores the original behaviors for the `body` parameters and converts nulls to `""`. Commits ------- 39aec09 [HttpClient] Handle requests with null body
In the cached file of my application I can see the following code fragment that have been generated by Symfony: ```php if (( !((array_key_exists("render_preferred_choices", $context)) ? (_twig_default_filter((isset($context["render_preferred_choices"]) || array_key_exists("render_preferred_choices", $context) ? $context["render_preferred_choices"] : (function () { throw new RuntimeError('Variable "render_preferred_choices" does not exist.', 88, $this->source); })()), false)) : (false)) && Symfony\Bridge\Twig\Extension\twig_is_selected_choice($context["choice"], (isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 88, $this->source); })())))) { echo " selected=\"selected\""; } ``` The 2nd Arg passed when calling ``twig_is_selected_choice`` if the result of ``(isset($context["value"]) || array_key_exists("value", $context) ? $context["value"]``. In that condition, if ``$context['value'] = null, we pass the null Currently I got the following error: ``` Symfony\Bridge\Twig\Extension\twig_is_selected_choice(): Argument #2 ($selectedValue) must be of type array|string, null given, called in X:\workspace-novento\novento-vip-lounge\var\cache\admin_dev\twig\01\01615438ee40292438687b29025d08a9.php on line 534 ```
…el057) This PR was merged into the 6.0 branch. Discussion ---------- Allow passing null in twig_is_selected_choice | Q | A | ------------- | --- | Branch? | 6.0 and > | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT In the cached file of my application, generated by Symfony I can see the following code fragment: ```php if (( !((array_key_exists("render_preferred_choices", $context)) ? (_twig_default_filter((isset($context["render_preferred_choices"]) || array_key_exists("render_preferred_choices", $context) ? $context["render_preferred_choices"] : (function () { throw new RuntimeError('Variable "render_preferred_choices" does not exist.', 88, $this->source); })()), false)) : (false)) && Symfony\Bridge \Twig\Extension\twig_is_selected_choice($context["choice"], (isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 88, $this->source); })())))) { echo " selected=\"selected\""; } ``` The 2nd Arg passed when calling ``twig_is_selected_choice`` is the result of ``(isset($context["value"]) || array_key_exists("value", $context) ? $context["value"]``. So in case ``$context['value'] = null``, we pass ``null`` as 2nd arg of ``twig_is_selected_choice``. As a result in some case, when I submit form with empty (null) value, I got the following error: ``` Symfony\Bridge\Twig\Extension\twig_is_selected_choice(): Argument #2 ($selectedValue) must be of type array|string, null given, called in ...\var\cache\dev\twig\01\01615438ee40292438687b29025d08a9.php on line 534 ``` Commits ------- 0186ecb Allow passing null in twig_is_selected_choice
…es (SerafimArts) This PR was squashed before being merged into the 6.2 branch. Discussion ---------- [VarDumper] Add `FFI\CData` and `FFI\CType` types | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Added support of FFI: ```php $ffi = \FFI::cdef(<<<'CPP' typedef struct { int x; int y; } Point; typedef struct Example { uint8_t array[32]; long longVal; __extension__ union { __extension__ struct { short shortVal; }; struct { Point point; float e; }; }; bool boolValue; int (*func)(struct __sub *h); } Example; CPP); $struct = $ffi->new('Example'); $struct->func = (static fn (object $ptr) => 42); dump($struct); ``` **Before** ``` FFI\CData {#2} ``` **After** ``` FFI\CData<struct Example> size 64 align 8 {#2 +array: FFI\CData<uint8_t[32]> size 32 align 1 {symfony#18} +int32_t longVal: 0 +int16_t shortVal: 0 +point: FFI\CData<struct <anonymous>> size 8 align 4 {symfony#17 +int32_t x: 0 +int32_t y: 0 } +float e: 0.0 +bool boolValue: false +func: [cdecl] callable(struct __sub*): int32_t {symfony#20 returnType: FFI\CType<int32_t> size 4 align 4 {symfony#25} } } ``` P.S. I apologize for the multiple force pushes, errors in tests and codestyle have been fixed. ## Review And TODOs - Pointers - [x] Pointer to scalar tests. - [x] Pointer to struct tests. - [x] "Special" pointer to `char*` tests (with `\0` and without `\0`). - Possible Errors - [x] Do not dump union fields with pointer references (possible SIGSEGV). Commits ------- 1c7dc52 [VarDumper] Add `FFI\CData` and `FFI\CType` types
…(HypeMC) This PR was merged into the 6.2 branch. Discussion ---------- [HttpKernel] Fix `CacheAttributeListener` priority | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Currently the `CacheAttributeListener` & the `IsGrantedAttributeListener` have the same priority: ``` Registered Listeners for "kernel.controller_arguments" Event ============================================================ ------- --------------------------------------------------------------------------------------------------------- ---------- Order Callable Priority ------- --------------------------------------------------------------------------------------------------------- ---------- #1 Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments() 10 #2 Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments() 10 #3 Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments() 0 ------- --------------------------------------------------------------------------------------------------------- ---------- ``` Since the `CacheAttributeListener` is alphabetically first, it's first to get triggered. This can cause an unauthenticated user to receive a 304 Not modified instead of a 302 Redirect, resulting in the user seeing some stale content from when they were authenticated instead of getting redirected to the login page. This PR changes the priority of the `CacheAttributeListener` to be lower than that of the `IsGrantedAttributeListener`. Commits ------- 90eb89f [HttpKernel] Fix CacheAttributeListener priority
…azak) This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- [Serializer] Fix CsvEncoder decode on empty data | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Test that reproduces the error: https://gist.github.com/cazak/954d8bfe53d5b9139667eae8fe53957f The message i get after running the test: 1x: explode(): Passing null to parameter #2 ($string) of type string is deprecated 1x in CsvEncoderTest::testSuccess from App\Tests\Functional\Task Commits ------- 6c22622 [Serializer] Fix CsvEncoder decode on empty data
…rows PHP 8.1 deprecation when no user agent is set (juagarc4) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [MonologBridge] FirePHPHandler::onKernelResponse throws PHP 8.1 deprecation when no user agent is set | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes/no | New feature? no | Deprecations? no | Tickets | Fix symfony#49392 | License | MIT - Add casting to the second parameter to pass always the right type. **PHPstan before:** ------ -------------------------------------------------------------------------------------------------------- Line FirePHPHandler.php ------ -------------------------------------------------------------------------------------------------------- 27 Property Symfony\Bridge\Monolog\Handler\FirePHPHandler::$headers has no type specified. 37 Method Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse() has no return type specified. **44 Parameter #2 $subject of function preg_match expects string, string|null given.** 68 If condition is always true. ------ -------------------------------------------------------------------------------------------------------- **PHPstan after:** ------ -------------------------------------------------------------------------------------------------------- Line FirePHPHandler.php ------ -------------------------------------------------------------------------------------------------------- 27 Property Symfony\Bridge\Monolog\Handler\FirePHPHandler::$headers has no type specified. 37 Method Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse() has no return type specified. 68 If condition is always true. ------ -------------------------------------------------------------------------------------------------------- Commits ------- 4d84c46 [MonologBridge] FirePHPHandler::onKernelResponse throws PHP 8.1 deprecation when no user agent is set
…ult Enum parameter in constructor (kapiwko) This PR was submitted for the 6.3 branch but it was squashed and merged into the 5.4 branch instead. Discussion ---------- [VarDumper] Fix error when reflected class has default Enum parameter in constructor | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | no | License | MIT | Doc PR | no Have classes: ``` enum GeometryType: string { case Geometry = 'GEOMETRY'; } ``` ``` final class Geometry { public function __construct(GeometryType $type = GeometryType::Geometry) { } } ``` Try to dump reflection of class Geometry: ``` $reflection = new \ReflectionClass(Geometry::class); dump($reflection); ``` Have error: `Symfony\Component\VarDumper\Caster\ConstStub::__construct(): Argument #2 ($value) must be of type string|int|float|null, App\Infrastructure\Geometry\GeometryType given, called in [...]/vendor/symfony/var-dumper/Caster/ReflectionCaster.php on line 296` Commits ------- d6a7730 [VarDumper] Fix error when reflected class has default Enum parameter in constructor
…form field type inside array (l-naumann) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Mime] Throw InvalidArgumentException on invalid form field type inside array | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT Example code: ```php $f = new FormDataPart([ 'foo' => [ 'bar' => 'baz', 'qux' => [ 'quux' => 1, ], ], ]); $f->getParts(); ``` Currently, when you use a disallowed type inside an array, a TypeError is thrown: ` Symfony\Component\Mime\Part\Multipart\FormDataPart::configurePart(): Argument #2 ($part) must be of type Symfony\Component\Mime\Part\TextPart, int given` This change adds a clearly understandable error message: `The value of the form field "foo[qux][quux]" can only be a string, an array, or an instance of TextPart ("int" given).` Commits ------- 08f5d7c [Mime] Throw InvalidArgumentException on invalid form field type inside array
This PR was merged into the 5.4 branch. Discussion ---------- [Process] Fixed inconsistent test | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | N/A | License | MIT Sometimes the process no longer appears to be running when the signal is sent which causes a LogicException to be thrown. This doesn't appear to be consistent and I can reproduce it randomly on my local machine. To avoid having tests fail at random I decided that it's better to send the signal only if the process is still marked as running. ```bash amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php PHP Fatal error: Uncaught Symfony\Component\Process\Exception\LogicException: Cannot send signal on a non running process. in /home/amne/work/projects/symfony/src/Symfony/Component/Process/Process.php:1502 Stack trace: #0 /home/amne/work/projects/symfony/src/Symfony/Component/Process/Process.php(516): Symfony\Component\Process\Process->doSignal() #1 /home/amne/work/projects/symfony/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php(28): Symfony\Component\Process\Process->signal() #2 {main} thrown in /home/amne/work/projects/symfony/src/Symfony/Component/Process/Process.php on line 1502 ``` Commits ------- 00ee4ca [Process] Fixed inconsistent test
…read from socket (xdanik) This PR was merged into the 5.4 branch. Discussion ---------- [Mailer] Throw `TransportException` when unable to read from socket | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? |no | Issues | None | License | MIT We are seeing error `fgets(): SSL: Connection reset by peer` multiple times a day from connection to Office 365 SMTP server (smtp.office365.com:587). It's certainly related to some kind of timeout as we are sending emails from long running queue dispatcher and error shows up only occasionally and never with the first message. We are not seeing this issue with any other SMTP server, but we have not tested much past smtp.mandrillapp.com and local MailHog. We have tried adjusting the `$pingThreshold` and `$restartThreshold` options, but without much success (well `$restartThreshold = 1` resolves the issue, but it also forces the transport to close connection after each message). Stack trace: ``` #0 /var/www/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php(77): fgets(Resource(stream)) #1 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(315): Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream->readLine() #2 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(181): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->getFullResponse() #3 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(140): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->executeCommand("RSET ", Array(1)) #4 /var/www/vendor/symfony/mailer/Mailer.php(45): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send(Object(Symfony\Component\Mime\Email), Null) symfony#5 (our queue dispatcher): Symfony\Component\Mailer\Mailer->send(Object(Symfony\Component\Mime\Email)) ``` App is running on PHP 8.0.28 on Debian Linux x64, Mailer v5.4.22. I would gladly written some tests for this, but I don't know how to simulate calls to low-level stream functions like fgets. Commits ------- 44d5b57 [Mailer] Throw TransportException when unable to read from socket
…hen publishing a message. (jwage) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message. | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#36538 Fix symfony#48241 | License | MIT If you have a message handler that dispatches messages to another queue, you can encounter `AMQPConnectionException` with the message "Library error: a SSL error occurred" or "a socket error occurred" depending on if you are using tls or not or if you are running behind a load balancer or not. You can manually reproduce this issue by dispatching a message where the handler then dispatches another message to a different queue, then go to rabbitmq admin and close the connection manually, then dispatch another message and when the message handler goes to dispatch the other message, you will get this exception: ``` a socket error occurred #0 /vagrant/vendor/symfony/amqp-messenger/Transport/AmqpTransport.php(60): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpSender->send() #1 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(62): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransport->send() #2 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle() #3 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(61): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle() #4 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle() symfony#5 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle() symfony#6 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle() symfony#7 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle() symfony#8 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch() symfony#9 /vagrant/src/Messenger/MessageBus.php(37): Symfony\Component\Messenger\TraceableMessageBus->dispatch() symfony#10 /vagrant/vendor/symfony/mailer/Mailer.php(66): App\Messenger\MessageBus->dispatch() symfony#11 /vagrant/src/Mailer/Mailer.php(83): Symfony\Component\Mailer\Mailer->send() symfony#12 /vagrant/src/Mailer/Mailer.php(96): App\Mailer\Mailer->send() symfony#13 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(118): App\Mailer\Mailer->sendEmail() symfony#14 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(72): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->handle() symfony#15 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(152): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->__invoke() symfony#16 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(91): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->callHandler() symfony#17 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(71): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->handle() symfony#18 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle() symfony#19 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(68): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle() symfony#20 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle() symfony#21 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle() symfony#22 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle() symfony#23 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle() symfony#24 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch() symfony#25 /vagrant/vendor/symfony/messenger/RoutableMessageBus.php(54): Symfony\Component\Messenger\TraceableMessageBus->dispatch() symfony#26 /vagrant/vendor/symfony/messenger/Worker.php(162): Symfony\Component\Messenger\RoutableMessageBus->dispatch() symfony#27 /vagrant/vendor/symfony/messenger/Worker.php(109): Symfony\Component\Messenger\Worker->handleMessage() symfony#28 /vagrant/vendor/symfony/messenger/Command/ConsumeMessagesCommand.php(238): Symfony\Component\Messenger\Worker->run() symfony#29 /vagrant/vendor/symfony/console/Command/Command.php(326): Symfony\Component\Messenger\Command\ConsumeMessagesCommand->execute() symfony#30 /vagrant/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run() symfony#31 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(126): Symfony\Component\Console\Application->doRunCommand() symfony#32 /vagrant/vendor/symfony/console/Application.php(324): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() symfony#33 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(80): Symfony\Component\Console\Application->doRun() symfony#34 /vagrant/vendor/symfony/console/Application.php(175): Symfony\Bundle\FrameworkBundle\Console\Application->doRun() symfony#35 /vagrant/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php(49): Symfony\Component\Console\Application->run() symfony#36 /vagrant/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() symfony#37 /vagrant/bin/console(11): require_once('...') symfony#38 {main} ``` TODO: - [x] Add test for retry logic when publishing messages Commits ------- f123370 [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.
…cing keys (Brajk19) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Validator] UniqueValidator - normalize before reducing keys | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT In symfony#42403 checking for uniqueness of certain collection keys was enabled. Method `UniqueValidator::reduceElementKeys` removes all keys which are not specified. Problem is that this happens before normalization, which in my opinion is not great because that method accepts array argument and if i have some object (DTO), TypeError will be thrown. Example: ```php class ParentDTO { /** * `@var` ChildDTO[] */ #[Assert\Unique( normalizer: [ChildDTO::class, 'normalize'] fields: 'id' )] public array $children; } ``` ```php class ChildDTO { public string $id; public string $name; public static function normalize(self $obj): array { return [ 'id' => $obj->id, 'name' => $obj->name ]; } } ``` Because normalization will happen after `reduceElementKeys` this will be thrown: `TypeError: Symfony\Component\Validator\Constraints\UniqueValidator::reduceElementKeys(): Argument #2 ($element) must be of type array, ...\ChildDTO given, called in .../UniqueValidator.php on line 48` If `$element = $normalizer($element);` is executed before `reduceElementKeys` it would enable using Assert\Unique with array of objects when correctly normalized Commits ------- 77df90b [Validator] UniqueValidator - normalize before reducing keys
…s string similar to username/password (glaubinix) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Security] Validate that CSRF token in form login is string similar to username/password | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | See exception output below | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Fixes ``` Uncaught Error: Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge::__construct(): Argument #2 ($csrfToken) must be of type ?string, array given, called in /vendor/symfony/security-http/Authenticator/FormLoginAuthenticator.php on line 88 ``` Commits ------- b501bba [Security] Validate that CSRF token in form login is string similar to username/password
…alexandre-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Fix cURL default options for PHP 8.4 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT PHP 8.4 brings a change in ext/curl (php/php-src#13291) that requires `CurlResponse` to be updated. Curl callbacks cannot be set to null anymore and requires real callable. Here is (one of) the CI error it fixes: ``` 10) Symfony\Component\HttpClient\Tests\CurlHttpClientTest::testGzipBroken Failed asserting that exception of type "TypeError" matches expected exception "Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface". Message was: "curl_setopt_array(): Argument #2 ($options) must be a valid callback for option CURLOPT_PROGRESSFUNCTION, no array or string given" at /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/CurlResponse.php:175 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Internal/Canary.php:32 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php:90 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php:218 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/CommonResponseTrait.php:68 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/CurlResponse.php:232 /home/runner/work/symfony/symfony/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php:1113 ``` Commits ------- cc0b957 [HttpClient] Fix cURL default options
…h()` (simoheinonen) This PR was merged into the 5.4 branch. Discussion ---------- [MonologBridge] Fix PHP deprecation with `preg_match()` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT ``` preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated ``` Commits ------- 4d7a6f6 Passing null to parameter #2 ($subject) of type string is deprecated
* 5.4: do not mix named and positional arguments in data provider definitions session names must not be empty fix Contracts directory name in PHPUnit configuration Passing null to parameter #2 ($subject) of type string is deprecated
* 6.4: do not mix named and positional arguments in data provider definitions session names must not be empty fix Contracts directory name in PHPUnit configuration Passing null to parameter #2 ($subject) of type string is deprecated
* 7.1: do not mix named and positional arguments in data provider definitions session names must not be empty add missing properties fix Contracts directory name in PHPUnit configuration [Validator][CidrValidator] Fix error message for `OutOfRangeNetmask` validation Passing null to parameter #2 ($subject) of type string is deprecated
… 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
ping @iltar If you find this ok, I'll merge it within some hours :)