Commit Graph

40888 Commits

Author SHA1 Message Date
Fabien Potencier
30b96175a6 feature #30744 [Finder] Throw a dedicated exception for non-existing directory (xelan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Finder] Throw a dedicated exception for non-existing directory

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes [1]
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no [2]
| Tests pass?   | yes
| Fixed tickets | #30723
| License       | MIT
| Doc PR        | N/A [3]

Makes `Finder::in()` throw a `DirectoryNotFoundException` instead of an `InvalidArgumentException` if one of the directories is not found.
This behavior is more consistent with the `AccessDeniedException` for files which are unreadable due to insufficient permissions.
To keep backward compatibility, the new exception class inherits from `InvalidArgumentException`.

[1] A valid, but non-existent directory name is IMHO not an invalid argument
[2] However, it may be semantically better to extend from `RuntimeException`,  This would require a deprecation.
[3] Possible exceptions are currently not explained at https://symfony.com/doc/current/components/finder.html

Commits
-------

48d5f94cda Throw a dedicated exception for non-existing directory
2019-03-30 08:28:10 +01:00
Fabien Potencier
7cb14f3186 fixed typo 2019-03-30 08:22:54 +01:00
Fabien Potencier
6ffad7bba4 feature #30759 [Messenger] Adding the "sync" transport to call handlers synchronously (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Adding the "sync" transport to call handlers synchronously

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

This adds a `sync://` transport that just calls the handlers immediately. Why? This allows you to route your messages to some "async" transport. But then, when developing locally or running your tests, you can choose to run them synchronously instead:

```yml
# config/packages/messenger.yaml
framework:
    messenger:
        transports:
            async: '%env(MESSENGER_TRANSPORT_DSN)%'
        routing:
            'App\Message\SmsNotification': async
            'App\Message\OtherMessage': async
```

```
# .env
# by default, handle this sync
MESSENGER_TRANSPORT_DSN=sync://
```

```
# .env.local on production (or set this via real env vars)
# on production, use amqp
MESSENGER_TRANSPORT_DSN=amqp://.......
```

Cheers!

Commits
-------

3da5a438aa Adding the "sync" transport to call handlers synchronously
2019-03-30 08:22:14 +01:00
Fabien Potencier
3edb79f5d3 feature #30772 [Contracts][EventDispatcher] move the Event class to symfony/contracts (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Contracts][EventDispatcher] move the Event class to symfony/contracts

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

Will allow decoupling more components in 5.0

Commits
-------

a4ce08ec30 [Contracts][EventDispatcher] move the Event class to symfony/contracts
2019-03-30 08:19:14 +01:00
Fabien Potencier
f4176b0cf6 fixed typos 2019-03-30 08:02:29 +01:00
Fabien Potencier
b12351a7eb feature #30708 [Messenger] ReceiverInterface::handle() to get() & Worker with prioritized transports (weaverryan)
This PR was squashed before being merged into the 4.3-dev branch (closes #30708).

Discussion
----------

[Messenger] ReceiverInterface::handle() to get() & Worker with prioritized transports

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

Highlights:

* `messenger:consume` can now consume messages from multiple transports with priority ️

```
bin/console messenger:consume amqp_high amqp_medium amqp_low
```

* How long you want to sleep before checking more messages is now an option to `messenger:consume`
* `ReceiverInterface::receive()` is replaced with `ReceiverInterface::get()`
* Logic for looping & sleeping is moved into `Worker`

Commits
-------

e800bd5bde [Messenger] ReceiverInterface::handle() to get() & Worker with prioritized transports
2019-03-30 08:01:33 +01:00
Ryan Weaver
e800bd5bde [Messenger] ReceiverInterface::handle() to get() & Worker with prioritized transports 2019-03-30 08:01:26 +01:00
Nicolas Grekas
a4ce08ec30 [Contracts][EventDispatcher] move the Event class to symfony/contracts 2019-03-29 19:47:03 +01:00
Fabien Potencier
2389d7c686 Revert "feature #30651 Allow user to set the project dir (tdutrion)"
This reverts commit aa12dd0bd7, reversing
changes made to 7d01aae41e.
2019-03-29 18:00:10 +01:00
Fabien Potencier
c203379dd5 feature #27648 [Lock] Added MongoDBStore (Joe Bennett)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Lock] Added MongoDBStore

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes (requires `ext-mongodb` and `mongodb/mongodb` to test)
| Fixed tickets | #27345
| License       | MIT
| Doc PR        | symfony/symfony-docs#9807

**Testing caveat**
In order to test this, the test environment needs `ext-mongodb` and `mongodb/mongodb`.

I have both written the test and tested `Symfony\Component\Lock\Store\MongoDbStore` and it does pass in an environment with `ext-mongodb` and `mongodb/mongodb`.

**Description**
We should support Semaphore Locks with a MongoDB back end to allow those that already use MongoDB as a distributed storage engine.

Symfony already partially supports MongoDB for session storage: `Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler`

**Example**

```php
$client = new MongoDb\Client();

$store = new Symfony\Component\Lock\Store\MongoDbStore(
    $client
    array(
        'database' => 'my-app',
    )
);
$lockFactory = new Symfony\Component\Lock\Factory($store);
$lock = $lockFactory->createLock('my-resource');
```

This is a squashed pull request of https://github.com/symfony/symfony/pull/27346

Commits
-------

9c04639dc3 #27345 Added Lock/Store/MongoDbStore
2019-03-29 17:15:05 +01:00
Samuel ROZE
37b616fefb minor #30764 [Messenger] Changing message handling log levels to higher levels (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Changing message handling log levels to higher levels

| 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

Update log levels so that the user can configure the logger to be notified of errors. This was really an oversight when I originally added the logging.

Cheers!

Commits
-------

9153c48bc4 Changing message handling log levels to higher levels
2019-03-29 21:53:56 +07:00
Ryan Weaver
9153c48bc4 Changing message handling log levels to higher levels 2019-03-29 09:51:35 -04:00
Joe Bennett
9c04639dc3 #27345 Added Lock/Store/MongoDbStore 2019-03-29 23:39:57 +10:00
Ryan Weaver
3da5a438aa Adding the "sync" transport to call handlers synchronously 2019-03-28 14:59:51 -04:00
Nicolas Grekas
162d5a8272 feature #30752 [HttpClient] use "nyholm/psr7" by default in Psr18Client (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] use "nyholm/psr7" by default in Psr18Client

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

This makes the factory arguments of `Psr18Client` optional, with a fallback to using `Nyholm\Psr7\Factory\Psr17Factory` when no factories are provided.

Commits
-------

f2222e4bf5 [HttpClient] use "nyholm/psr7" by default in Psr18Client
2019-03-28 17:44:24 +01:00
Nicolas Grekas
f2222e4bf5 [HttpClient] use "nyholm/psr7" by default in Psr18Client 2019-03-28 17:41:24 +01:00
Nicolas Grekas
efb6414f6b bug #30755 [HttpClient] correctly clean state on destruct in CurlResponse (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] correctly clean state on destruct in CurlResponse

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

On destruct, we ask curl to close the stream once the headers arrived, but we don't silence the "error" this sets in curl. This fixes it.

Commits
-------

332a88c8ce [HttpClient] correctly clean state on destruct in CurlResponse
2019-03-28 17:34:47 +01:00
Nicolas Grekas
332a88c8ce [HttpClient] correctly clean state on destruct in CurlResponse 2019-03-28 16:53:35 +01:00
Samuel ROZE
c30f462c2e feature #30671 Add optional parameter prefetching for AMQP connection (fbouchery)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Add optional parameter `prefetching` for AMQP connection

Add prefetching connection parameter to setup channel prefetch count.

| 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 setting up AMQP transport connection, it can be interesting to configure prefetching on a channel, which is not currently possible.

Commits
-------

47777eedd6 Add optional parameter `prefetching` in connection configuration, to setup channel prefetch count
2019-03-28 18:47:49 +07:00
Nicolas Grekas
4184cc6bf2 minor #30731 [PropertyInfo] Add missing changelog for private / protected (joelwurtz)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PropertyInfo] Add missing changelog for private / protected

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

Add missing changelog for #30706

Commits
-------

8c5663d1cf Add missing changelog for private / protected
2019-03-28 12:42:00 +01:00
Andreas Erhard
48d5f94cda
Throw a dedicated exception for non-existing directory
Makes Finder::in() throw a DirectoryNotFoundException instead of an InvalidArgumentException if one of the directories is not found.
This behavior is more consistent with the AccessDeniedException for files which are unreadable due to insufficient permissions.
To keep BC, the new exception class inherits from InvalidArgumentException.
2019-03-28 12:28:31 +01:00
Nicolas Grekas
8551ec7ca9 feature #25707 [DI] ServiceProviderInterface, implementation for ServiceLocator (kejwmen)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DI] ServiceProviderInterface, implementation for ServiceLocator

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

Implements #25686

Not sure if it needs any additional documentation, @nicolas-grekas?

Commits
-------

aaf5422cfb [DI][Contracts] add and implement ServiceProviderInterface
2019-03-28 12:26:01 +01:00
Mateusz Sip
aaf5422cfb [DI][Contracts] add and implement ServiceProviderInterface 2019-03-28 12:22:02 +01:00
fbouchery
47777eedd6 Add optional parameter prefetching in connection configuration, to setup channel prefetch count
Co-Authored-By: f2r <frederic.bouchery+github@gmail.com>
2019-03-28 18:20:31 +07:00
Nicolas Grekas
708639f453 minor #30740 [HttpClient] Remove unused local variable (samnela)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] Remove unused local variable

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

Commits
-------

60b077337c [HttpClient] Remove unused local variable
2019-03-28 12:14:50 +01:00
Samuel NELA
60b077337c [HttpClient] Remove unused local variable 2019-03-28 10:31:46 +01:00
Joel Wurtz
8c5663d1cf
Add missing changelog for private / protected 2019-03-27 14:33:41 +01:00
Fabien Potencier
71c33c1531 feature #30606 [Validator] allow brackets in the optional query string (Emmanuel BORGES)
This PR was squashed before being merged into the 4.3-dev branch (closes #30606).

Discussion
----------

[Validator] allow brackets in the optional query string

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

Add the `allowBrackets` option from the Url constraint to allow brackets in the optional query string.

Commits
-------

40dc4c89df [Validator] allow brackets in the optional query string
2019-03-27 13:34:45 +01:00
Emmanuel BORGES
40dc4c89df [Validator] allow brackets in the optional query string 2019-03-27 13:32:56 +01:00
Samuel ROZE
91b0afaef3 feature #29476 [Messenger] Add a command to setup transports (vincenttouzet)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Add a command to setup transports

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

This PR add a `SetupTransportsCommand` that allow to setup the transports.

Actually the `AMQPTransport` is setup only if debug is enabled. With this PR the new `messenger:setup-transports` will setup all declared transports.

Commits
-------

fbb534a838 [Messenger] Add a command to setup transports
2019-03-27 18:26:38 +07:00
Fabien Potencier
8f995e6c07 minor #30722 [TwigBridge] fix tests (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[TwigBridge] fix tests

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

Commits
-------

578d842bcd fix tests
2019-03-27 10:13:43 +01:00
Christian Flothmann
578d842bcd fix tests 2019-03-27 10:09:36 +01:00
Fabien Potencier
93018de198 feature #30719 [Mime] Add BodyRendererInterface (fabpot)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mime] Add BodyRendererInterface

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| 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

<!--
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.
-->

Commits
-------

0c9d684d0a [Mime] added BodyRendererInterface
2019-03-27 09:45:25 +01:00
Fabien Potencier
a35ad63191 feature #30664 [Finder] Get filename without extension (antonch1989)
This PR was squashed before being merged into the 4.3-dev branch (closes #30664).

Discussion
----------

[Finder] Get filename without extension

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

Commits
-------

821e55ab80 [Finder] Get filename without extension
2019-03-27 09:36:49 +01:00
Anton Chernikov
821e55ab80 [Finder] Get filename without extension 2019-03-27 09:36:42 +01:00
Fabien Potencier
0c9d684d0a [Mime] added BodyRendererInterface 2019-03-27 08:07:59 +01:00
Fabien Potencier
19c6639452 bug #30718 [Mime] Fix serialization of Message instances (fabpot)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mime] Fix serialization of Message instances

| 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

Commits
-------

f5386ffb2a [Mime] fixed serialization of Message instances
2019-03-27 08:00:39 +01:00
Fabien Potencier
f5386ffb2a [Mime] fixed serialization of Message instances 2019-03-27 07:58:31 +01:00
Fabien Potencier
0c02a40d72 feature #30645 Alias for each assets package (gpenverne)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Alias for each assets package

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

Add autowiring by type + name on assets packages
```yaml
framework:
    assets:
        packages:
            xxx:
                base_urls: 'xxxx'
```
```php
<?php

class MyService
{
    private $xxxPackage;

    public function __construct(PackageInterface $xxxPackage)
    {
        $this->xxxPackage = $xxxPackage;
        ...
    }

    public function myMethod(): string
    {
        return $this->xxxPackage->getUrl('some-image.png');
    }
}
```
instead of:
```php
<?php

class MyService
{
    private $packages;

    public function __construct(Packages $packages)
    {
        $this->packages = $packages;
        ...
    }

    public function myMethod(): string
    {
        return $this->packages->getPackage('xxx')->getUrl('some-image.png');
    }
}
```

Commits
-------

e8b9856ec3 Alias for each assets package
2019-03-27 07:44:58 +01:00
Fabien Potencier
8952c021c5 feature #30706 [PropertyInfo] Add possibility to extract private and protected properties in reflection extractor (joelwurtz)
This PR was squashed before being merged into the 4.3-dev branch (closes #30706).

Discussion
----------

[PropertyInfo] Add possibility to extract private and protected properties in reflection extractor

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

This PR add the possibility to extract private and protected properties from a class by passing a new argument to the `ReflectionExtractor`

This new argument consist of flag that filters properties, so someone will also be able to use the `ReflectionExtractor` only for private property

```php
new ReflectionExtractor(null, null, null, true, ReflectionExtractor::ALLOW_PRIVATE | ReflectionExtractor::ALLOW_PROTECTED)
```

Flags method was prefered over a list of bool to avoid too many parameters and also be close to the reflection API of PHP

Commits
-------

05e487f3b2 [PropertyInfo] Add possibility to extract private and protected properties in reflection extractor
2019-03-27 07:41:49 +01:00
Joel Wurtz
05e487f3b2 [PropertyInfo] Add possibility to extract private and protected properties in reflection extractor 2019-03-27 07:41:42 +01:00
Fabien Potencier
bc18e3919a feature #27808 [DI] Deprecate non-string default envs (ro0NL)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DI] Deprecate non-string default envs

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes-ish
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes
| Tests pass?   | no    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27680, https://github.com/symfony/symfony/pull/27470#discussion_r196678923
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This is a failing test to further clarify the issues raised in #27680

So given https://github.com/symfony/symfony/issues/27680#issuecomment-399402480

> We should be sure this solves a real-world issue.

I think it solves a real bug :)

Commits
-------

2311437c9f [DI] Deprecate non-string default envs
2019-03-27 07:31:58 +01:00
Fabien Potencier
c949f9a282 feature #30691 [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible

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

This PR adds a new `EventDispatcherInterface` in `Contracts`. This interface contains only one method: `dispatch($event, $eventName)`. That covers almost all use cases of the event dispatcher in components (some use add/removeListeners/Subscribers but they are a minority.)

While doing so, it allows dispatching any objects as events - not only instances of `Event`.

This allows decoupling e.g. `Messenger` from the `EventDispatcher` component.
Next steps could be about planning to remove the base `Event` class from some concrete event classes and/or moving `EventSubscriberInterface` to `symfony/contracts`. It would allow decoupling e.g. `Workflow` from the component - but that's too far away for now, let's think about it in 5.1.

Commits
-------

3c3db2f14a [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible
2019-03-27 07:28:10 +01:00
Fabien Potencier
08faa536d1 minor #30716 Fixing bad return on getter (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Fixing bad return on getter

| 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

My bad - this method is only to make the Symfony Serializer happy (not used in our code), so I missed it. Test added to be sure.

Commits
-------

f3b3b2f4f3 Fixing bad return on getter
2019-03-27 07:27:38 +01:00
Fabien Potencier
79aeed640a feature #20978 [Form] TransformationFailedException: Support specifying message to display (ogizanagi)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] TransformationFailedException: Support specifying message to display

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

Currently, a failed transformation can't display a very accurate message, as it only uses the value of the `invalid_message` option. I suggest to add more flexibility, somehow the same way we did for `CustomUserMessageAuthenticationException`.

A test case in `FormTypeTest` shows a use-case based on @webmozart's [blog post about value/immutable objects in Symfony forms](https://webmozart.io/blog/2015/09/09/value-objects-in-symfony-forms/).

~I named the exception properties and methods the same way as for `CustomUserMessageAuthenticationException`, but do you think the followings would be better:~

- ~`setSafeMessage` ➜ `setInvalidMessage`~
- ~`getMessageKey` ➜ `getInvalidMessageKey`~
- ~`getMessageData` ➜ `getInvalidMessageParameters`~

~in order to echoes `invalid_message` and `invalid_message_parameters` options?~

=> Replaced to use `invalidMessage` & `invalidMessageParameters`

Commits
-------

d11055cc1c [Form] TransformationFailedException: Support specifying message to display
2019-03-27 07:26:31 +01:00
Ryan Weaver
f3b3b2f4f3 Fixing bad return on getter 2019-03-26 23:10:31 -04:00
Maxime Steinhausser
d11055cc1c [Form] TransformationFailedException: Support specifying message to display 2019-03-26 22:35:30 +01:00
Vincent Touzet
fbb534a838 [Messenger] Add a command to setup transports 2019-03-26 21:08:11 +01:00
Roland Franssen
2311437c9f [DI] Deprecate non-string default envs 2019-03-26 18:14:00 +01:00
Fabien Potencier
76260e7d44 minor #30667 [Validator] BIC remove unused sprintf and parameter (kaznovac)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] BIC remove unused sprintf and parameter

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

removed surplus parameter and sprintf as there are no placeholders in message template

Commits
-------

131e495269 [Validator] BIC remove unused sprintf and parameter
2019-03-26 11:26:31 +01:00