Commit Graph

40976 Commits

Author SHA1 Message Date
Fabien Potencier
b921076df4 bug #30805 [Messenger] bug fixes in Doctrine Transport (vincenttouzet)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] bug fixes in Doctrine Transport

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Just tested the new Doctrine transport and I've see 3 bugs so far :
- [x] The message is not return by the transport
- [x] The headers column must be of type TEXT and not just STRING
- [ ] When using the PhpSerializer the message is truncated (PR: https://github.com/symfony/symfony/pull/30814)

The body in database looks like this :
```
O:36:"Symfony\Component\Messenger\Envelope":2:{s:44:"
```

The body given by the serializer is the following :
```
O:36:"Symfony\Component\Messenger\Envelope":2:{s:44:"Symfony\Component\Messenger\Envelopestamps";a:3:{s:49:"Symfony\Component\Messenger\Stamp\SerializerStamp";a:1:{i:0;O:49:"Symfony\Component\Messenger\Stamp\SerializerStamp":1:{s:58:"Symfony\Component\Messenger\Stamp\SerializerStampcontext";a:0:{}}}s:46:"Symfony\Component\Messenger\Stamp\BusNameStamp";a:1:{i:0;O:46:"Symfony\Component\Messenger\Stamp\BusNameStamp":1:{s:55:"Symfony\Component\Messenger\Stamp\BusNameStampbusName";s:21:"messenger.bus.default";}}s:43:"Symfony\Component\Messenger\Stamp\SentStamp";a:1:{i:0;O:43:"Symfony\Component\Messenger\Stamp\SentStamp":2:{s:56:"Symfony\Component\Messenger\Stamp\SentStampsenderClass";s:64:"Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport";s:56:"Symfony\Component\Messenger\Stamp\SentStampsenderAlias";s:16:"environment.stop";}}}s:45:"Symfony\Component\Messenger\Envelopemessage";O:34:"App\Message\EnvironmentStopMessage":1:{s:51:"App\Message\AbstractEnvironmentMessageenvironment";O:22:"App\Entity\Environment":5:{s:26:"App\Entity\Environmentid";s:36:"3bade252-b7a9-4188-82bd-3e68129e0da7";s:37:"App\Entity\EnvironmentrepositoryUrl";s:6:"string";s:30:"App\Entity\Environmentbranch";s:6:"string";s:33:"App\Entity\EnvironmenthostNames";a:1:{i:0;N;}s:27:"App\Entity\Environmentenv";a:2:{s:7:"APP_ENV";s:4:"prod";s:7:"APP_VAR";s:13:"example value";}}}}
```

Commits
-------

27466498d0 [Messenger] Fix get in Doctrine Transport
2019-04-01 16:43:38 +02:00
Fabien Potencier
1a5ab6b750 bug #30814 [Messenger] base64_encoding inside PhpSerializer to avoid null characters (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] base64_encoding inside PhpSerializer to avoid null characters

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30805
| License       | MIT
| Doc PR        | not needed

Hi!

As pointed out in #30805, the `PhpSerializer` creates strings with null bytes. This apparently causes problems on at least some database systems (I didn't notice, but @vincenttouzet did). I also read that, for example, SQS doesn't like null characters. And, in general, because we're sending this data over a transport, `base64_encoding` data is pretty standard.

Does anyone see any downsides?

Cheers!

Commits
-------

fe7ad812c7 base64_encoding inside PhpSerializer to avoid null characters
2019-04-01 16:41:45 +02:00
Fabien Potencier
643e9f6b9d minor #30815 [Process] Added more detail to the exception when the CWD is invalid (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Process] Added more detail to the exception when the CWD is invalid

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

---

When using panther with "special" directory structure, the message is
not really usefull. Let's add the CWD to the exception

Commits
-------

d27858f77b [Process] Added more detail to the exception when the CWD is invalid
2019-04-01 16:24:06 +02:00
Fabien Potencier
c8670ee6ca feature #30810 [Inflector] remove "internal" marker from the component (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Inflector] remove "internal" marker from the component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/26903
| License       | MIT
| Doc PR        | -

This code works: making it non-internal won't increase the maintenance burden and can help others build on it.

Commits
-------

164b45b79c [Inflector] remove "internal" marker from the component
2019-04-01 16:12:23 +02:00
Nicolas Grekas
164b45b79c [Inflector] remove "internal" marker from the component 2019-04-01 15:53:46 +02:00
Grégoire Pineau
d27858f77b [Process] Added more detail to the exception when the CWD is invalid 2019-04-01 15:29:45 +02:00
Ryan Weaver
fe7ad812c7 base64_encoding inside PhpSerializer to avoid null characters 2019-04-01 08:36:54 -04:00
Robin Chalas
9bcea2e9f4 fix test name 2019-03-31 23:15:36 +02:00
Fabien Potencier
5d0fa550df bug #30806 [EventDispatcher] Fix FC layer (bis) (chalasr)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[EventDispatcher] Fix FC layer (bis)

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

2e02986b26 [EventDispatcher] Fix FC layer (really)
2019-03-31 22:54:21 +02:00
Fabien Potencier
4c78b13ce6 minor #30807 [Messenger] Various minor fixes (fabpot)
This PR was squashed before being merged into the 4.3-dev branch (closes #30807).

Discussion
----------

[Messenger] Various minor fixes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| 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

Found while playing with the new Doctrine transport.

Commits
-------

96dee1ee20 [Messenger] fixed missing use statement
1044dfb93d [Messenger] simplified code
2019-03-31 22:43:17 +02:00
Robin Chalas
2e02986b26 [EventDispatcher] Fix FC layer (really) 2019-03-31 22:38:00 +02:00
Fabien Potencier
96dee1ee20 [Messenger] fixed missing use statement 2019-03-31 22:37:12 +02:00
Fabien Potencier
1044dfb93d [Messenger] simplified code 2019-03-31 22:18:13 +02:00
Vincent Touzet
27466498d0 [Messenger] Fix get in Doctrine Transport 2019-03-31 20:44:41 +02:00
Fabien Potencier
9669e13554 [Messenger] made a const private 2019-03-31 19:35:08 +02:00
Fabien Potencier
dafc357fb9 minor #30803 [Messenger] Remove unused option in the Doctrine transport (vincenttouzet)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Remove unused option in the Doctrine transport

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This PR remove the unused option `loop_sleep` in the Messenger Doctrine transport

Commits
-------

4811400372 [Messenger] Remove unused option in the Doctrine transport
2019-03-31 19:33:19 +02:00
Fabien Potencier
c54a6a2e1a minor #30802 [Messenger] Add psr/cache on Messenger's dependencies (sroze)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Add `psr/cache` on Messenger's dependencies

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30754
| License       | MIT
| Doc PR        | ø

Commits
-------

0b5004f59f Add `psr/cache` on Messenger's dependencies
2019-03-31 19:32:16 +02:00
Fabien Potencier
563900ffaa fixed CS 2019-03-31 19:31:00 +02:00
Fabien Potencier
dad5b01b9c feature #26890 [Inflector] Support pluralization in the inflector (mbabker)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Inflector] Support pluralization in the inflector

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not yet
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | Not Yet

At present the inflector only supports singularizing plural words, this PR adds the capability to pluralize singular words.

Commits
-------

06920a79c4 Support pluralization in the inflector
2019-03-31 19:29:55 +02:00
Samuel ROZE
0b5004f59f Add psr/cache on Messenger's dependencies 2019-03-31 18:23:22 +01:00
Fabien Potencier
592e72fc9c feature #28637 [Validator] add number constraints (jschaedl)
This PR was squashed before being merged into the 4.3-dev branch (closes #28637).

Discussion
----------

[Validator] add number constraints

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28608
| License       | MIT
| Doc PR        | tbd.

I added the following constraints:
* `Positive`
* `PositiveOrZero`
* `Negative`
* `NegativeOrZero`

Commits
-------

01870398eb [Validator] add number constraints
2019-03-31 19:19:07 +02:00
Jan Schädlich
01870398eb [Validator] add number constraints 2019-03-31 19:18:59 +02:00
Nicolas Grekas
6070151495 minor #30800 [Messenger] fix review (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] fix review

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Fixes my review left in #30754
/cc @weaverryan FYI

Commits
-------

a3de9020c8 [Messenger] fix review
2019-03-31 19:13:48 +02:00
Vincent Touzet
4811400372 [Messenger] Remove unused option in the Doctrine transport 2019-03-31 19:12:50 +02:00
Samuel ROZE
a9459c0980 minor #30799 [Messenger] Fix the Doctrine transport to use the new interface (sroze)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Fix the Doctrine transport to use the new interface

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29007
| License       | MIT
| Doc PR        | ø

Commits
-------

75e3355da5 Fix the Doctrine transport to use the new interface
2019-03-31 18:12:31 +01:00
Nicolas Grekas
a3de9020c8 [Messenger] fix review 2019-03-31 19:00:04 +02:00
Samuel ROZE
75e3355da5 Fix the Doctrine transport to use the new interface 2019-03-31 17:52:51 +01:00
Fabien Potencier
343d28e3d1 feature #30754 [Messenger] New messenger:stop-workers Command (weaverryan)
This PR was squashed before being merged into the 4.3-dev branch (closes #30754).

Discussion
----------

[Messenger] New messenger:stop-workers Command

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Kinda of #29451
| License       | MIT
| Doc PR        | symfony/symfony-docs#11236

o/ me again.

This requires and is built on top of #30708

When you deploy, all workers need to be stopped and restarted. That's not currently possible, unless you manually track the pids and send a SIGTERM signal. We can make that much easier :).

Now run:

```
bin/console messenger:stop-workers
```

And it will signal to all workers (even if they're distributed on other servers) that they should stop, once they finish processing their current message. This is done via a key in `cache.app`.

Cheers!

Commits
-------

58971627f5 [Messenger] New messenger:stop-workers Command
2019-03-31 18:41:56 +02:00
Ryan Weaver
58971627f5 [Messenger] New messenger:stop-workers Command 2019-03-31 18:41:31 +02:00
Fabien Potencier
8c2ade9173 bug #30794 [EventDispatcher] Fix BC/FC layer (chalasr)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[EventDispatcher] Fix BC/FC layer

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Fixes
> TypeError: Argument 3 passed to Symfony\Component\EventDispatcher\EventDispatcher::doDispatch() must be an instance of Symfony\Component\EventDispatcher\Event

Spotted in https://github.com/lexik/LexikJWTAuthenticationBundle/pull/637

Commits
-------

caa0aded89 [EventDispatcher] Fix BC layer
2019-03-31 18:36:43 +02:00
Samuel ROZE
fd4146c768 Add back missing uses 2019-03-31 17:35:18 +01:00
Fabien Potencier
825335374a bug #30756 Changing to MessageDecodingFailedException so that invalid messages are rejected (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Changing to MessageDecodingFailedException so that invalid messages are rejected

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  |  no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30649
| License       | MIT
| Doc PR        | not needed for bug fix

Bug fix if a message body is completely blank. I'm fixing this on master only, because in 4.2 and earlier, there is actually no system in place to fail serialization and cause the messages to be rejected. In 4.3, we just need to throw this exception.

Cheers!

Commits
-------

4be827d3ca Changing to MessageDecodingFailedException so that invalid messages are rejected
2019-03-31 18:34:24 +02:00
Fabien Potencier
177a0d9320 bug #30798 [Messenger] Updating SyncTransport for recent changes + tests (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Updating SyncTransport for recent changes + tests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | not needed

When making the `SyncTransport`, I neglected having at least one test in each of these classes, which allowed the test suite to pass, even after some interface changes made these classes fail. Fixed all of that :)

Commits
-------

2df023be46 Updating SyncTransport for recent changes + tests
2019-03-31 18:31:45 +02:00
Fabien Potencier
3abca64c5d feature #30707 [Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch() (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | TODO

Me again o/!

This proposal is *purely* for DX. With `DelayStamp`, the proposal of QueueNameStamp and future things like `AmqpRoutingKeyStamp`, stamps are becoming more common for end users to use. This changes how it looks to use them:

```php
// before
$bus->dispatch(new Envelope(new SendSmsNotification('Hi!'), new DelayStamp(10), new QueueNameStamp('low')));

// after
$bus->dispatch(new SendSmsNotification('Hi!'), [new DelayStamp(10), new QueueNameStamp('low')]);
```

It's definitely a BC break, which is allowed because the component is experimental, though it should be minimized. This BC break shouldn't be felt by most end users, as creating your own bus is an advanced use-case. Even if you decorated it, you'll get an obvious error.

Commits
-------

e861de7e61 Allow stamps to be passed directly to MessageBusInterface::dispatch()
2019-03-31 18:29:02 +02:00
Samuel ROZE
e897e6cc4e Add missing word in CHANGELOG 2019-03-31 17:26:00 +01:00
Samuel ROZE
d9e2732a7d feature #29007 [Messenger] Add a Doctrine transport (vincenttouzet)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Add a Doctrine transport

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#10616
| DoctrineBundle PR | doctrine/DoctrineBundle#868

As discussed with @sroze at PHPForum in Paris I've worked on adding a Doctrine transport to the Messenger component.

Actually `AMQP` is the only supported transport and it could be a good thing to support multiple transports. Having a Doctrine transport could help users to start using the component IMHO (Almost all projects use a database).

# How it works

The code is splitted betwwen this PR and the one on the DoctrineBundle : doctrine/DoctrineBundle#868

## Configuration

To configure a Doctrine transport the dsn MUST have the format `doctrine://<entity_manager_name>` where `<entity_manager_name>` is the name of the entity manager (usually `default`)
```yml
        # config/packages/messenger.yaml
        framework:
            messenger:
                transports:
                    my_transport: "doctrine://default?queue=important"
```

## Table schema

Dispatched messages are stored into a database table with the following schema:

| Column       | Type     | Options                  | Description                                                       |
|--------------|----------|--------------------------|-------------------------------------------------------------------|
| id           | bigint   | AUTO_INCREMENT, NOT NULL | Primary key                                                       |
| body         | text     | NOT NULL                 | Body of the message                                               |
| headers      | text     | NOT NULL                 | Headers of the message                                            |
| queue      | varchar(32)     | NOT NULL                 | Headers of the message                                            |
| created_at   | datetime | NOT NULL                 | When the message was inserted onto the table. (automatically set) |
| available_at       | datetime   | NOT NULL                 | When the message is available to be handled                      |
| delivered_at | datetime | NULL                     | When the message was delivered to a worker                        |

## Message dispatching

When dispatching a message a new row is inserted into the table. See `Symfony\Component\Messenger\Transport\Doctrine::publish`

## Message consuming

The message is retrieved by the `Symfony\Component\Messenger\Transport\Doctrine\DoctrineReceiver`. It calls the `Symfony\Component\Messenger\Transport\Doctrine::get` method to get the next message to handle.

### Getting the next message

* Start a transaction
* Lock the table to get the first message to handle (The lock is done with the `SELECT ... FOR UPDATE` query)
* Update the message in database to update the delivered_at columns
* Commit the transaction

### Handling the message

The retrieved message is then passed to the handler. If the message is correctly handled the receiver call the `Symfony\Component\Messenger\Transport\Doctrine::ack` which delete the message from the table.

If an error occured the receiver call the `Symfony\Component\Messenger\Transport\Doctrine::nack` method which update the message to set the delivered_at column to `null`.

## Message requeueing

It may happen that a message is stuck in `delivered` state but the handler does not really handle the message (Database connection error, server crash, ...). To requeue messages the `DoctrineReceiver` call the `Symfony\Component\Messenger\Transport\Doctrine::requeueMessages`. This method update all the message with a  `delivered_at` not null since more than the "redeliver timeout" (default to 3600 seconds)

# TODO

- [x] Add tests
- [x] Create DOC PR
- [x] PR on doctrine-bundle for transport factory
- [x] Add a `available_at` column
- [x] Add a `queue` column
- [x] Implement the retry functionnality : See #30557
- [x] Rebase after #29476

Commits
-------

88d008c828 [Messenger] Add a Doctrine transport
2019-03-31 17:25:18 +01:00
Ryan Weaver
e861de7e61 Allow stamps to be passed directly to MessageBusInterface::dispatch()
And changing signature of Envelope::__construct() to accept an array of envelopes
2019-03-31 12:05:21 -04:00
Ryan Weaver
4be827d3ca Changing to MessageDecodingFailedException so that invalid messages are rejected 2019-03-31 11:54:28 -04:00
Ryan Weaver
2df023be46 Updating SyncTransport for recent changes + tests 2019-03-31 11:45:52 -04:00
Fabien Potencier
88042a317a feature #30628 Making the serializer configurable by transport (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Making the serializer configurable by transport

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30293 (already closed, but I don't think this was reasonably possible before)
| License       | MIT
| Doc PR        | TODO - as many of the new messenger PRs will be done at once

Use cases:
* #30293
* Transport A will be consumed by your Symfony app (so native php serialization is cool) but transport B will be consumed by another app, so you want to serialize as JSON
* Upgrading from Symfony 4.2 to 4.3. The change to the `PhpSerialize` means that messages that were sent to the queue on 4.2, will fail on 4.3. The solution is to use the old serializer in your config. This would allow you to make your existing transport use the old serializer, then migrate to a new transport using the new serializer (then remove the old one later).

Thanks!

Commits
-------

ef6f23e8b9 Making the serializer configurable by transport
2019-03-31 16:55:57 +02:00
Ryan Weaver
ef6f23e8b9 Making the serializer configurable by transport 2019-03-31 16:54:31 +02:00
Vincent Touzet
88d008c828 [Messenger] Add a Doctrine transport 2019-03-31 16:05:11 +02:00
Fabien Potencier
07276642de fixed typo 2019-03-31 15:49:16 +02:00
Fabien Potencier
dd47fda441 fixed bad merge 2019-03-31 14:18:54 +02:00
Fabien Potencier
460da96f45 feature #30569 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service (moynzzz)
This PR was squashed before being merged into the 4.3-dev branch (closes #30569).

Discussion
----------

[FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| 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 | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | none <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 master branch.
-->

Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service.

Commits
-------

fbfc623b72 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
2019-03-31 14:12:04 +02:00
Simeon Kolev
fbfc623b72 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service 2019-03-31 14:11:56 +02:00
Robin Chalas
caa0aded89 [EventDispatcher] Fix BC layer 2019-03-31 14:11:52 +02:00
Fabien Potencier
b14d5cd358 feature #26484 [Validator] String normalization options for string-based validators (renan-taranto)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] String normalization options for string-based validators

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26239
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/9433

Todo:
- [x] Document the new options
- [x] Update Doc PR

Add trimming options to the string constraints.

Commits
-------

708d759b8d [Validator] String normalization options for string-based validators
2019-03-31 13:55:59 +02:00
Fabien Potencier
6bc2ae4018 feature #30320 [Form][TwigBridge] Add row_attr to form theme (alexander-schranz)
This PR was squashed before being merged into the 4.3-dev branch (closes #30320).

Discussion
----------

[Form][TwigBridge] Add row_attr to form theme

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | waiting for confirmation to implement
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Currently you need to copy the whole form_row block if you just want to add a class to the form_row div. Instead we could introduce a `row_attr` which can then simple be set the following in the theme e.g.:

```twig
{% block form_row %}
    {% set row_attr = { class: 'form__field' } %}
    {{ parent() }}
{% endblock %}
```

or in php:

```
$builder->add('test', TextType::class, ['row_attr' => ['class' => 'form__field']]);
```

Commits
-------

7ab1b00e02 [Form][TwigBridge] Add row_attr to form theme
2019-03-31 13:48:32 +02:00
Alexander Schranz
7ab1b00e02 [Form][TwigBridge] Add row_attr to form theme 2019-03-31 13:48:18 +02:00