213 Commits

Author SHA1 Message Date
Nicolas Grekas
0fda7bff18 [Messenger] Add a --fetch-size option to the messenger:consume command to control how many messages are fetched per iteration 2026-03-16 08:45:09 +01:00
Nicolas Grekas
0c70db95c2 Merge branch '8.0' into 8.1
* 8.0: (27 commits)
  [JsonStreamer] Fix exponential resource class memory growth
  [Cache] Fix DSN auth not passed to clusters in RedisTrait
  do not parse "scalar" as an object
  [Form] Fix OrderedHashMap auto-increment logic with mixed keys
  [HttpClient] Skip HTTP/3 when using a proxy
  don't skip custom view transformers while normalizing submitted newlines
  [Serializer] Fix is/has/can accessor naming regression while preserving collision detection
  fix exception "Symfony\Component\TypeInfo\Exception\InvalidArgumentException: "Symfony\Component\TypeInfo\Type\UnionType" expects at least 2 types." when property phpdoc is "value-of<Enum>|null"
  [DoctrineBridge] Fix custom type based on Uid on entity loader
  let tests fail on PHPUnit notices
  [PropertyInfo] Throw when phpdocumentor/reflection-docblock v6 is in use (branch 6.4 only)
  do not use PHPUnit mock objects without configured expectations
  [Form] Fix ICU 72+ whitespace handling in `DateTimeToLocalizedStringTransformer`
  [ErrorHandler] fix parsing of complexe type
  do not use PHPUnit mock objects without configured expectations
  [Process] Adjust Process mustRun method phpdoc
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  ...
2026-01-23 12:09:22 +01:00
Nicolas Grekas
51125aec4e * 7.4: (27 commits) [JsonStreamer] Fix exponential resource class memory growth [Cache] Fix DSN auth not passed to clusters in RedisTrait do not parse "scalar" as an object [Form] Fix OrderedHashMap auto-increment logic with mixed keys [HttpClient] Skip HTTP/3 when using a proxy don't skip custom view transformers while normalizing submitted newlines [Serializer] Fix is/has/can accessor naming regression while preserving collision detection fix exception "Symfony\Component\TypeInfo\Exception\InvalidArgumentException: "Symfony\Component\TypeInfo\Type\UnionType" expects at least 2 types." when property phpdoc is "value-of<Enum>|null" [DoctrineBridge] Fix custom type based on Uid on entity loader let tests fail on PHPUnit notices [PropertyInfo] Throw when phpdocumentor/reflection-docblock v6 is in use (branch 6.4 only) do not use PHPUnit mock objects without configured expectations [Form] Fix ICU 72+ whitespace handling in DateTimeToLocalizedStringTransformer [ErrorHandler] fix parsing of complexe type do not use PHPUnit mock objects without configured expectations [Process] Adjust Process mustRun method phpdoc do not use PHPUnit mock objects without configured expectations do not use PHPUnit mock objects without configured expectations do not use PHPUnit mock objects without configured expectations do not use PHPUnit mock objects without configured expectations ... v8.0.4 2026-01-23 12:07:10 +01:00
yoye
892e932f75 Add sorting option to DebugCommand for recurring messages 2026-01-21 08:17:45 +01:00
Christian Flothmann
caa4688dd7 Merge branch '7.3' into 7.4
* 7.3:
  do not use PHPUnit mock objects without configured expectations
v7.4.4
2026-01-19 11:50:45 +01:00
Christian Flothmann
ef8d6fb803 Merge branch '6.4' into 7.3
* 6.4:
  do not use PHPUnit mock objects without configured expectations
v7.3.10
2026-01-19 11:50:30 +01:00
Kantin CHARIGNON
237fea46ee do not use PHPUnit mock objects without configured expectations v6.4.32 2026-01-19 11:15:20 +01:00
Nicolas Grekas
72e9293f89 Merge branch '8.0' into 8.1
* 8.0:
  Fix merge
  [WebProfiler] fix the security profiler template
  add tests for bypassed headers
  [Scheduler] Array to string conversion when using AsCronTask with array options
  the Serializer component does not work with PropertyInfo < 7.4
  [Config] Fix merging node that canBeDisable()/canBeEnabled()
  [ObjectMapper] error when multiple targets and no condition
2026-01-10 14:59:01 +01:00
Nicolas Grekas
6f8f86de44 Merge branch '7.4' into 8.0
* 7.4:
  Fix merge
  [WebProfiler] fix the security profiler template
  add tests for bypassed headers
  [Scheduler] Array to string conversion when using AsCronTask with array options
  [Config] Fix merging node that canBeDisable()/canBeEnabled()
  [ObjectMapper] error when multiple targets and no condition
2026-01-10 14:58:55 +01:00
Nicolas Grekas
4a0f31d0d8 Merge branch '7.3' into 7.4
* 7.3:
  Fix merge
2026-01-10 14:57:06 +01:00
Nicolas Grekas
fe7831a619 Fix merge 2026-01-10 14:57:00 +01:00
Nicolas Grekas
a2e98d7c78 Merge branch '7.3' into 7.4
* 7.3:
  [WebProfiler] fix the security profiler template
  [Scheduler] Array to string conversion when using AsCronTask with array options
2026-01-10 14:56:23 +01:00
Nicolas Grekas
9e79551667 Merge branch '6.4' into 7.3
* 6.4:
  [Scheduler] Array to string conversion when using AsCronTask with array options
2026-01-10 14:56:14 +01:00
Santiago San Martin
606deddf08 [Scheduler] Array to string conversion when using AsCronTask with array options 2026-01-09 20:14:45 -03:00
Christian Flothmann
9263753380 Merge branch '8.0' into 8.1
* 8.0:
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  fix CS
  do not use PHPUnit mock objects without configured expectations
  [Scheduler] Fix array to string conversion in `#[AsCronTask]` arguments
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  fix merge
  do not use PHPUnit mock objects without configured expectations
2026-01-08 23:37:08 +01:00
Christian Flothmann
154c301d92 Merge branch '7.4' into 8.0
* 7.4:
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  fix CS
  do not use PHPUnit mock objects without configured expectations
  [Scheduler] Fix array to string conversion in `#[AsCronTask]` arguments
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  fix merge
  do not use PHPUnit mock objects without configured expectations
2026-01-08 23:36:47 +01:00
Christian Flothmann
15523f2b49 Merge branch '7.3' into 7.4
* 7.3:
  do not use PHPUnit mock objects without configured expectations
  do not use PHPUnit mock objects without configured expectations
  fix CS
  [Scheduler] Fix array to string conversion in `#[AsCronTask]` arguments
2026-01-08 23:32:07 +01:00
Christian Flothmann
4fd5bd1eb8 Merge branch '6.4' into 7.3
* 6.4:
  do not use PHPUnit mock objects without configured expectations
  fix CS
  [Scheduler] Fix array to string conversion in `#[AsCronTask]` arguments
2026-01-08 23:26:38 +01:00
Christian Flothmann
f46f52d194 fix CS 2026-01-08 16:14:00 +01:00
Serhii Bondarenko
ddd1e04e73 [Scheduler] Fix array to string conversion in #[AsCronTask] arguments 2026-01-08 15:51:23 +01:00
Dariusz Ruminski
ce1ccc0522 PHP CS Fixer: enable static_lambda 2025-12-19 09:33:17 +01:00
Nicolas Grekas
01eb236fda Merge branch '7.4' into 8.0
* 7.4: (28 commits)
  [Console] Rename `#[Input]` to `#[MapInput]`
  [FrameworkBundle] Fix support of dumping workflow when workflow is decorated by TraceableWorkflow
  [JsonStreamer] Fix documentation link in README
  [Meta] Better exception when symfony link cannot read a JSON
  [Form] Add new `active_at`, `not_active_at` and `legal_tender` options to `CurrencyType`
  [Intl] Support time in generated data in currencies validity
  [Validator] Improve and complete Japanese translations
  [HtmlSanitizer] Remove redundant assignment to promoted property $config in constructor
  [Validator] Fix Polish translation for word count validation message
  [DependencyInjection][Routing] Deprecate XML configuration format
  [Validator] Review and fix Czech translation
  [DependencyInjection][Routing] Handle declaring services and routes using PHP arrays that follow the same shape as corresponding yaml files
  [Mailer][MailJet] Fix forbidden headers case-sensitive comparison
  [DependencyInjection][Config][Routing] Deprecate using `$this` or the internal scope of the loader from PHP config files
  [Config] Add array-shapes to generated config builders
  [DependencyInjection] Handle returning arrays and config-builders from config files
  [WebProfilerBundle] Simplify toolbar CSS
  do not use deprecated PHPUnit features
  replace PHPUnit annotation with attribute
  [Serializer] xml empty array encoding
  ...
v8.0.0 v8.0.0-RC1 v8.0.0-BETA1
2025-10-01 16:43:00 +02:00
Fabien Potencier
481caa4284 Merge branch '7.3' into 7.4
* 7.3:
  [Mailer][MailJet] Fix forbidden headers case-sensitive comparison
  do not cast too big floats to int
  [Scheduler] Don’t get next run date from `null`
  [JsonPath] Add @alexandre-daubois as code owner
  do not pass more than one byte to ord()
v7.4.0 v7.4.0-RC1 v7.4.0-BETA1
2025-09-30 08:01:53 +02:00
matlec
e44f8b0907 [Scheduler] Don’t get next run date from null v7.3.5 2025-09-29 10:38:43 +02:00
Nicolas Grekas
0a8826a6c0 Merge branch '7.4' into 8.0
* 7.4: (31 commits)
  [Validator] Update Romanian translations
  fix tests
  [JsonStreamer] Fix decoding iterable lists
  [String][Inflector] Fix edge cases
  [Serializer][Validator] Add JSON schema for validating and autocompleting YAML config files
  [DependencyInjection] Allow adding resource tags using any config formats
  Fix merge
  Add missing Sweego Mailer Bridge webhook events
  [Security] Fix attribute-based chained user providers
  [Intl] Fix Intl::getIcuStubVersion()
  [Intl] Add methods to filter currencies more precisely
  [Notifier] Add tests for option classes
  Sync intl scripts
  [Intl] Add metadata about currencies' validtity dates
  Bump Symfony version to 7.3.4
  Update VERSION for 7.3.3
  Update CHANGELOG for 7.3.3
  Bump Symfony version to 6.4.26
  Update VERSION for 6.4.25
  Update CONTRIBUTORS for 6.4.25
  ...
2025-09-01 11:26:06 +02:00
Nicolas Grekas
bb567ecea8 [DependencyInjection] Allow adding resource tags using any config formats 2025-08-30 11:57:47 +02:00
Nicolas Grekas
4703fa6206 Merge branch '7.4' into 8.0
* 7.4:
  Use phpunit attribute
  Remove some implicit bool type juggling
  [Scheduler] Fix `scheduler.task` tag arguments optionality
  use false instead of null to hide the currency symbol
  [FrameworkBundle] Fix block type from `OK` to `ERROR` when local vault is disabled in `SecretsRemoveCommand`
  run tests with PHPUnit 12.1 on PHP >= 8.3
  Fix wrong boolean values
  minor #61328 [FrameworkBundle] Decouple ControllerResolverTest from HttpKernel (nicolas-grekas)
  [Messenger] Fix NoAutoAckStamp handling in Worker::flush()
  [DependencyInjection] Dump XML using plain PHP, no DOM needed
2025-08-05 12:26:20 +02:00
Nicolas Grekas
3578ca9653 Use phpunit attribute 2025-08-05 12:25:04 +02:00
Nicolas Grekas
79ad888a3d Merge branch '7.3' into 7.4
* 7.3:
  [Scheduler] Fix `scheduler.task` tag arguments optionality
  use false instead of null to hide the currency symbol
  [FrameworkBundle] Fix block type from `OK` to `ERROR` when local vault is disabled in `SecretsRemoveCommand`
  Fix wrong boolean values
  minor #61328 [FrameworkBundle] Decouple ControllerResolverTest from HttpKernel (nicolas-grekas)
  [Messenger] Fix NoAutoAckStamp handling in Worker::flush()
2025-08-05 12:16:35 +02:00
Jan Pintr
782fb9b77f [Scheduler] Fix scheduler.task tag arguments optionality v7.3.3 2025-08-05 11:22:42 +02:00
Nicolas Grekas
037d180b8e Merge branch '7.4' into 8.0
* 7.4:
  replace PHPUnit annotations with attributes
2025-08-04 09:36:47 +02:00
Christian Flothmann
db284b0c5b replace PHPUnit annotations with attributes 2025-08-04 09:05:15 +02:00
Nicolas Grekas
49bc9751e3 Merge branch '7.4' into 8.0
* 7.4:
  run tests using PHPUnit 11.5
  make data provider static
  [Lock] Fix using fractional TTLs on all platforms
  [Lock] Fixes an issue with PostgreSQL when using fractional TTLs
  [Console][Table] Fix unnecessary wrapping
  [DependencyInjection] Deprecate registering a service without a class when its id is a non-existing FQCN
  disable detecting modified indexes with DBAL 4.3
  [cache] RedisTrait::doFetch should use pipeline instead of mget for Relay\Cluster
  relax assertions for forward compatibility with Symfony 7.4
  [Console][Table] Fix invalid UTF-8 due to text wrapping
2025-08-01 18:41:19 +02:00
Christian Flothmann
1b180cfb7a run tests using PHPUnit 11.5 2025-07-31 11:31:17 +02:00
Nicolas Grekas
c6dddf4434 CS fixes v6.4.24 2025-07-10 10:14:14 +02:00
Nicolas Grekas
93121c8d68 Merge branch '7.4' into 8.0
* 7.4:
  [ObjectMapper] handle non existing property errors
  Fix AsCronTask not passing arguments to command
  [HttpFoundation] Fix deprecation in tests on PHP 8.5
  Fix typo
  [Cache] Bump ext-redis to 6.2 and ext-relay to 0.11 minimum
  [VarExporter] Dump implicit-nullable types as explicit to prevent the corresponding deprecation
  [DependencyInjection] CS fix
  chore: PHP CS Fixer fixes
  Leverage get_error_handler()
  Various CS fixes
  Allow mixed root on CompoundConstraintTestCase validator
  [Serializer] Fix readonly property initialization from incorrect scope
  Update BrevoRequestParser.php
  [JsonPath] Improve escape sequence validation in name selector
2025-07-09 12:08:17 +02:00
Nicolas Grekas
4d0a10ce78 Merge branch '7.3' into 7.4
* 7.3:
  [ObjectMapper] handle non existing property errors
  Fix AsCronTask not passing arguments to command
  [HttpFoundation] Fix deprecation in tests on PHP 8.5
  Fix typo
  [VarExporter] Dump implicit-nullable types as explicit to prevent the corresponding deprecation
  [DependencyInjection] CS fix
  Allow mixed root on CompoundConstraintTestCase validator
  [Serializer] Fix readonly property initialization from incorrect scope
  Update BrevoRequestParser.php
  [JsonPath] Improve escape sequence validation in name selector
2025-07-09 11:57:56 +02:00
Jan Pintr
0183b701bb Fix AsCronTask not passing arguments to command v7.3.2 2025-07-09 11:46:14 +02:00
Yonel Ceruto
4ceea5eead Remove deprecated methods and legacy code 2025-06-06 08:52:05 +02:00
Nicolas Grekas
5af24947d3 Bump Symfony 8 to PHP >= 8.4 2025-06-03 14:29:50 +02:00
Nicolas Grekas
ac9f564c11 Allow Symfony ^8.0 2025-06-02 16:13:49 +02:00
Adrian Rudnik
e0a7be42d4 [Scheduler] Throw error on duplicate schedule provider service registration on the schedule name 2025-05-30 18:38:33 +02:00
Christian Flothmann
5fd65e13fe replace assertEmpty() with stricter assertions v7.3.0 v7.3.0-RC1 v7.3.0-BETA1 2025-03-05 11:15:41 +01:00
Christian Flothmann
2e70ee0f59 make newly added constructor argument optional
As the PostRunEvent class is already present in Symfony since 6.4 we cannot add
new mandatory constructor arguments without breaking backwards compatibility.
2025-02-08 13:14:06 +01:00
Christian Flothmann
65679a9694 fix tests 2025-02-07 14:38:26 +01:00
Fabien Potencier
a7d5718368 feature #58546 [Scheduler] Add MessageHandler result to the PostRunEvent (bartholdbos)
This PR was squashed before being merged into the 7.3 branch.

Discussion
----------

[Scheduler] Add MessageHandler result to the `PostRunEvent`

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

This PR will add the result of a MessageHandler to the PostRunEvent of the Scheduler Component. This can be used for example for retrieving the output of a RunCommandMessage scheduled by the scheduler component.

```
<?php

namespace App\Service;

use Symfony\Component\Console\Messenger\RunCommandMessage;
use Symfony\Component\Scheduler\Attribute\AsSchedule;
use Symfony\Component\Scheduler\RecurringMessage;
use Symfony\Component\Scheduler\Schedule;
use Symfony\Component\Scheduler\ScheduleProviderInterface;

#[AsSchedule]
class ScheduleProvider implements ScheduleProviderInterface
{
    public function getSchedule(): Schedule
    {
        $schedule = new Schedule();
        $schedule->add(RecurringMessage::cron('* * * * *', new RunCommandMessage('about')));

        return $schedule;
    }
}
```
```
<?php

namespace App\EventListener;

use Symfony\Component\Console\Messenger\RunCommandContext;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
use Symfony\Component\Scheduler\Event\PostRunEvent;

#[AsEventListener(event: PostRunEvent::class, method: 'onMessage')]
class SchedulerListener
{
    public function onMessage(PostRunEvent $event): void
    {
        $result = $event->getResult();

        if ($result instanceof RunCommandContext) {
            echo $result->output; //Log or store output somewhere
        }
    }
}
```

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the latest branch.
 - For new features, provide some code snippets to help understand usage.
 - 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).
-->

Commits
-------

306eeb6dd33 [Scheduler] Add MessageHandler result to the `PostRunEvent`
2025-02-07 09:23:32 +01:00
Barthold Bos
30a8558d82 [Scheduler] Add MessageHandler result to the PostRunEvent 2025-02-07 09:23:28 +01:00
Fabien Potencier
bb97a6bab5 feature #59679 [Scheduler] Normalize TriggerInterface as string (valtzu)
This PR was merged into the 7.3 branch.

Discussion
----------

[Scheduler] Normalize `TriggerInterface` as `string`

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | yes
| Deprecations? | no
| Issues        | Fix #53562
| License       | MIT

Fix the issue with Scheduler & Serializer like `@kbond` described in https://github.com/symfony/symfony/issues/53562#issuecomment-2353228245.

Fixes the following error:

```
Could not decode stamp: The type of the "trigger" attribute for class "Symfony\Component\Scheduler\Generator\MessageContext" must be one of "Symfony\Component\Scheduler\Trigger\TriggerInterface" ("array" given).
```

Commits
-------

3aa47e0ada2 Normalize `TriggerInterface` as `string`
2025-02-07 08:46:50 +01:00
Christian Flothmann
caf696bfea try reading the command name from the AsCommand attribute first 2025-02-06 15:31:18 +01:00
valtzu
72af1f5a98 Normalize TriggerInterface as string 2025-02-05 20:45:09 +02:00