Commit Graph

50328 Commits

Author SHA1 Message Date
Jérémy Derussé
080f1149a1
Reduce log verbosity for CombinedStore 2020-08-06 10:03:26 +02:00
Fabien Potencier
1382001dfe minor #37741 Typo: somes styles fixed (Pyrrah)
This PR was submitted for the master branch but it was merged into the 5.1 branch instead.

Discussion
----------

Typo: somes styles fixed

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #
| License       | MIT
| Doc PR        |

Typo: somes styles fixed

Commits
-------

3703f1440e Typo: somes styles fixed
2020-08-06 09:00:30 +02:00
Pierre-Yves
3703f1440e Typo: somes styles fixed 2020-08-06 09:00:23 +02:00
Fabien Potencier
d66a0a76e2 feature #36692 [HttpClient] add EventSourceHttpClient to consume Server-Sent Events (soyuka)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] add EventSourceHttpClient to consume Server-Sent Events

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | na
| License       | MIT
| Doc PR        | symfony/symfony-docs#...

<details>
 <summary>First implementation</summary>
This patch implements the [w3c Server-Sent Events specification](https://www.w3.org/TR/eventsource/#eventsource) on top of symfony's http client. It provides an `EventSource` class that allows you to interact of server sent events.

Comparing to the Javascript implementation, we won't be able to use the same API. Indeed, in php listeners need to be setup before we connect to the HTTP stream.
I'm not fond of adding a dependency to EventDispatcher from HTTP Client, therefore I'm all ears if you have better solutions.
About event parsing, I wanted to avoid using regular expression and it uses smart data split. Note that I had to concatenate an internal buffer and only handle the data when a newline is found to cover long chunks. This is an alternative to this [react php eventsource](https://github.com/clue/reactphp-eventsource). Note that this implementation is closer to the specification in some cases that are still to be covered by tests (`retry`, `data:value` without space after colon is valid etc.).
</details>

This is an implementation of the [Server-Sent Events specification](https://html.spec.whatwg.org/multipage/server-sent-events.html) based on symfony's HTTP Client. After a few suggestions on the first implementation (see details above), I've implemented a chunk generator with this kind of API:

```php
$client = new EventSourceHttpClient($client, 10);
$source = $client->connect('GET', "http://localhost:8080/events");
while($source) {
    foreach ($client->stream($source, 2) as $r => $chunk) {
        if ($chunk->isTimeout()) {
            dump([
                'timeout' => [
                    'retry' => 1 + count($r->getInfo('previous_info') ?? [])
                ],
            ]);
            continue;
        }
        if ($chunk->isLast()) {
            dump([
                'eof' => [
                    'retries' => count($r->getInfo('previous_info') ?? [])
                ],
            ]);
            $source = null;
            return;
        }

        dump($chunk);
    }
}
```

TODO:
- [x] validate implementation (~~don't use EventDispatcher ?~~, need to be implemented as `stream` instead of `message`)
- [x] default timeout value
- [x] implement retry/reconnection
- [x] tests (do test with super long chunk, retry, bad http content-type response)
- [ ] update changelog
- [ ] document

Commits
-------

12ccca3cd4 [HttpClient] add EventSourceHttpClient to consume Server-Sent Events
2020-08-06 08:59:15 +02:00
soyuka
12ccca3cd4 [HttpClient] add EventSourceHttpClient to consume Server-Sent Events 2020-08-06 08:59:09 +02:00
Fabien Potencier
5e2abc66c2 Fix previous merge 2020-08-06 08:17:52 +02:00
Fabien Potencier
558dfa8c56 feature #36616 [Notifier] Add Zulip notifier bridge (phpfour)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Add Zulip notifier bridge

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | See #33687
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/13604

This adds a [Zulip](https://zulipchat.com/) (another popular open source Slack alternative) transport for the new Notifier component.

#### Sample DSN

```ZULIP_DSN=zulip://test-bot@zulipchat.com:api-key@example.zulipchat.com?channel=builds```

#### Configuration

```yml
# config/packages/notifier.yaml
framework:
    notifier:
        chatter_transports:
            zulip: '%env(ZULIP_DSN)%'
```

#### Example

```php
public function index(ChatterInterface $chatter)
{
    $message = (new ChatMessage('New order arrived!', new ZulipOptions('Ordering')))
        ->transport('zulip');

    $chatter->send($message);

    ...
}
```

Commits
-------

bd4fd32121 Adds Zulip notifier bridge
2020-08-06 08:16:39 +02:00
Mohammad Emran Hasan
bd4fd32121 Adds Zulip notifier bridge 2020-08-06 08:16:18 +02:00
Fabien Potencier
b968497770 bug #37748 [Notifier] Fix SentMessage implementation (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Fix SentMessage implementation

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

#36611 broke the Notifier when used with Messenger.

/cc @jeremyFreeAgent

Commits
-------

92c28de41b [Notifier] Fix SentMessage implementation
2020-08-06 07:19:29 +02:00
Fabien Potencier
9db0f20c85 feature #37747 [Notifier] Make Freemobile config more flexible (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Make Freemobile config more flexible

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a<!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

As Freemobile only supports French phone numbers, let's support French numbers without the international code.

Commits
-------

4dfde6ae7c [Notifier] Make Freemobile config more flexible
2020-08-06 07:18:22 +02:00
Fabien Potencier
e43d6b3baf Merge branch '5.1'
* 5.1:
  fail properly when the required service is not defined
  Fix typo
  [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account
  Update UPGRADE-5.0.md
  Added the missing reset tag to mailer.logger_message_listener
  Fix invalid option sslmode
  Updated README for the Mailer component
  fix error with custom function and web profiler routing tab
2020-08-06 07:13:39 +02:00
Fabien Potencier
ea69524de9 Merge branch '4.4' into 5.1
* 4.4:
  fail properly when the required service is not defined
  Fix typo
  [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account
  Update UPGRADE-5.0.md
  Added the missing reset tag to mailer.logger_message_listener
  Updated README for the Mailer component
  fix error with custom function and web profiler routing tab
2020-08-06 07:08:30 +02:00
Fabien Potencier
d81eb081c3 bug #37729 [FrameworkBundle] fail properly when the required service is not defined (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fail properly when the required service is not defined

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Before:

```
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "mailer.logger_message_listener".
```

After:

```
A client must have Mailer enabled to make email assertions. Did you forget to require symfony/mailer?
```

Commits
-------

a16ebc177d fail properly when the required service is not defined
2020-08-06 07:03:59 +02:00
Fabien Potencier
92c28de41b [Notifier] Fix SentMessage implementation 2020-08-06 06:53:52 +02:00
Fabien Potencier
4dfde6ae7c [Notifier] Make Freemobile config more flexible 2020-08-06 06:52:01 +02:00
Gonzalo Vilaseca
81ca1f00a3 [HttpKernel] Provide status code in fragment handler exception 2020-08-04 11:02:58 +02:00
Fabien Potencier
995d784a0d bug #37701 [Serializer] Fix that it will never reach DOMNode (TNAJanssen)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix that it will never reach DOMNode

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT
| Doc PR        |

When providing the DOMNode object, the is_object check will return true. This way it will never reach the DOMNode check.

So i moved this check to above the is_object check.

Commits
-------

38787ac785 [Serializer] Fix that it will never reach DOMNode
2020-08-04 08:15:33 +02:00
Alexander Janssen
38787ac785 [Serializer] Fix that it will never reach DOMNode 2020-08-04 08:15:26 +02:00
Fabien Potencier
c0a707f0db feature #37718 [Security] class Security implements AuthorizationCheckerInterface (SimonHeimberg)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] class Security implements AuthorizationCheckerInterface

The class has the method of AuthorizationCheckerInterface already.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |  <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | <!-- required for new features -->

The class Security has the method for interface AuthorizationCheckerInterface already. By implementing the interface, Security can be passed to methods typehinted with AuthorizationCheckerInterface.

Commits
-------

cea6ebda5b [Security] class Security implements AuthorizationCheckerInterface
2020-08-04 08:13:57 +02:00
Fabien Potencier
f92b727f8a minor #37730 [Validator] sync translations (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] sync translations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

b7d2b6042b [Validator] sync translations
2020-08-04 08:12:54 +02:00
Fabien Potencier
6d2ee19b60 Fix CS 2020-08-04 08:11:14 +02:00
Fabien Potencier
b94eb47396 feature #37732 [Console] Allow testing single command apps using CommandTester (chalasr)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Allow testing single command apps using CommandTester

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/37723
| License       | MIT
| Doc PR        | -

Commits
-------

63407d8201 [Console] Allow disabling auto-exit for single command apps
2020-08-04 08:10:23 +02:00
Fran Moreno
27bb1c499d Fix typehint phpdoc 2020-08-03 20:22:34 +02:00
Robin Chalas
63407d8201 [Console] Allow disabling auto-exit for single command apps 2020-08-03 17:23:43 +02:00
Christian Flothmann
b7d2b6042b [Validator] sync translations 2020-08-03 15:22:15 +02:00
Christian Flothmann
a16ebc177d fail properly when the required service is not defined 2020-08-03 15:05:59 +02:00
Fabien Potencier
2ddacad477 Fix typehint 2020-08-02 10:17:48 +02:00
Fabien Potencier
681c66675e feature #37480 [Messenger] add redeliveredAt in RedeliveryStamp construct (qkdreyer)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Messenger] add redeliveredAt in RedeliveryStamp construct

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

---

this would allows one to correctly unserialize a RedeliveryStamp with a custom serializer not using the php serialize function

Commits
-------

64d26836da [Messenger] add redeliveredAt in RedeliveryStamp construct
2020-08-02 10:17:01 +02:00
Quentin Dreyer
64d26836da [Messenger] add redeliveredAt in RedeliveryStamp construct 2020-08-02 10:16:56 +02:00
Fabien Potencier
4105e935ac minor #37669 [EventDispatcher] Minor: Avoid not needed null check in dispatch() (brainexe)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[EventDispatcher] Minor: Avoid not needed null check in dispatch()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT
| Doc PR        | -

Just found a not needed null check in the heavyly called EventDispatcher::dispatch() method - the $eventName get's always a string now - no null anymore, as it gets the class name instead.

Commits
-------

0d36c11f28 [EventDispatcher] Avoid not needed null check in dispatch()
2020-08-02 10:13:42 +02:00
Fabien Potencier
f76ac74b20 feature #37565 [Validator] Add Isin validator constraint (lmasforne)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Validator] Add Isin validator constraint

Co-Authored-By: Yannis Foucher <33806646+YaFou@users.noreply.github.com>

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #36362
| License       | MIT
| Doc PR        | symfony/symfony-docs#13960

Rebase of https://github.com/symfony/symfony/pull/36368

I asked him by mail and he didn't have time to finish the PR and allowed me to do it.

Commits
-------

8e1ffc8b99 Feature #36362 add Isin validator constraint
2020-08-02 10:06:13 +02:00
Fabien Potencier
1889ba8fba feature #37712 [Mailer] Prevent MessageLoggerListener from leaking in env=prod (vudaltsov)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Mailer] Prevent MessageLoggerListener from leaking in env=prod

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

I was trying to send a batch of emails with `--env=prod` when I noticed that `MessageLoggerListener` was still collecting all the messages and leaking the memory. I tried to do `$this->getApplication()->reset()`, but it didn't work because `MessageLoggerListener` was not tagged (now fixed in #37705).

In this PR I propose to move the declaration of `MessageLoggerListener` to `mailer_debug.php` since the only service depending on it is `mailer.data_collector` from `mailer_debug.php`. If a developer needs to collect sent emails, a custom listener could be implemented on the project side.

- [x] deprecate the service
- [x] add a new one to `mailer_debug.php`
- [ ] add a line to CHANGELOG.md
- [ ] add a line to UPGRADE-5.2.md

Commits
-------

e226775d97 [Mailer] Prevent MessageLoggerListener from leaking in env=prod
2020-08-02 09:59:01 +02:00
vudaltsov
e226775d97 [Mailer] Prevent MessageLoggerListener from leaking in env=prod 2020-08-02 09:58:54 +02:00
Fabien Potencier
6c021cb5be minor #37713 [Lock] downgrade log.info to log.debug (rvitaliy)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Lock] downgrade log.info to log.debug

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.4 or 5.1 for bug fixes <!-- see below -->
| Bug fix?      | yes/no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #37710
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

we changed log behavior see issue for more details
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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 branch master.
-->

Commits
-------

eea41d9655 [Lock] downgrade log.info to log.debug
2020-08-02 09:57:49 +02:00
Vitaliy Ryaboy
eea41d9655 [Lock] downgrade log.info to log.debug 2020-08-02 09:57:41 +02:00
Laurent Masforné
8e1ffc8b99 Feature #36362 add Isin validator constraint
Feature #36362 typo

Fix PR feedbacks

Fix coding standard

ticket 36362 fix PR feedbacks

Update src/Symfony/Component/Validator/Constraints/IsinValidator.php

Co-Authored-By: Yannis Foucher <33806646+YaFou@users.noreply.github.com>
2020-08-01 14:37:35 +02:00
Simon Heimberg
cea6ebda5b [Security] class Security implements AuthorizationCheckerInterface
The class has the method of AuthorizationCheckerInterface already.
2020-07-31 19:01:17 +02:00
Fabien Potencier
b61fa4480b bug #37671 [Cache] fix saving no-expiry items with ArrayAdapter (philipp-kolesnikov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix saving no-expiry items with ArrayAdapter

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37667
| License       | MIT
| Doc PR        |

0 is a special value that means "infinity".

Commits
-------

bdec105a72 [Cache] Fix #37667
2020-07-31 09:57:22 +02:00
Fabien Potencier
de39dbae8f Fix previous merge 2020-07-31 09:51:09 +02:00
Fabien Potencier
2d5e7b0b25 feature #33729 [Console] Add signal event (marie)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Add signal event

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no
| Tickets       | Fix #33411
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This new feature allows to set a listener for performing some actions after the console command get a signal.

Usage:

```php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleSignalEvent;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\SignalRegistry\SignalRegistry;
use Symfony\Component\Console\Command\Command;

class HelloWorldCommand extends Command {
    protected static $defaultName = 'app:hello-world';
    protected function execute(InputInterface $input, OutputInterface $output) {}
}

$application = new Application();
$dispatcher = new EventDispatcher();

// Function that will handle signals
$dispatcher->addListener(ConsoleEvents::SIGNAL, function (ConsoleSignalEvent $event) {
    echo 'Handled signal #' . $event->getHandlingSignal() . PHP_EOL;
});

$application->setDispatcher($dispatcher);
$application->setSignalRegistry(new SignalRegistry());

// List of POSIX signals for handling
$application->addHandlingSignals(SIGINT, SIGUSR1);

$application->add(new HelloWorldCommand());
$application->run();
```

Commits
-------

859b692240 [Console] add console.signal event
2020-07-31 09:50:01 +02:00
marie
859b692240 [Console] add console.signal event 2020-07-31 09:49:38 +02:00
Fabien Potencier
b8529a03a6 Fix CHANGELOG 2020-07-31 09:45:25 +02:00
Fabien Potencier
bea6c99db7 feature #36352 [Validator] Added support for cascade validation on typed properties (HeahDude)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Validator] Added support for cascade validation on typed properties

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | ~
| License       | MIT
| Doc PR        | TODO

This PR leverages PHP 7.4 property types to "guess" typed object members and enable default cascade validation on nested objects.

Before:
```php
use Symfony\Component\Validator\Constraints as Assert;

class Composite
{
    /**
     * @var self[]
     *
     * @Assert\Valid
     */
    public array $children;

    /**
     * @Assert\Valid
     */
    public ?self $parent;

    /**
     * @Assert\Valid
     */
    public static ?self $root;
}
```

After:
```php
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @Assert\Cascade
 */
class Composite
{
    /*
     * @var self[]
     */
    public array $children;
    public ?self $parent;
    public static ?self $root;
}
```

The constraint can also be used in xml, yaml, and of course raw PHP.
___________
Question: is the naming ok, maybe we could use `CascadeValid` to be more explicit?

Commits
-------

f4679ef08a [Validator] Added support for cascade validation on typed properties
2020-07-31 09:44:40 +02:00
Jules Pietri
f4679ef08a [Validator] Added support for cascade validation on typed properties 2020-07-31 09:44:26 +02:00
Fabien Potencier
f1dc422394 feature #37243 [DependencyInjection] Resolve parameters in tag arguments (rpkamp)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[DependencyInjection] Resolve parameters in tag arguments

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35337
| License       | MIT
| Doc PR        | None, yet, will follow if this is accepted

Arguably this could be a BC break if people are actively relying on parameters not being resolved in tag parameters, although I can't come up with a sensible use case for that scenario.

Commits
-------

3dba1fe7bf [DependencyInjection] Resolve parameters in tag arguments
2020-07-31 09:38:46 +02:00
Remon van de Kamp
3dba1fe7bf [DependencyInjection] Resolve parameters in tag arguments 2020-07-31 09:38:40 +02:00
Fabien Potencier
7aaf99d9f2 feature #37415 [Console] added info method to symfony style (titospeakap, titomiguelcosta)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] added info method to symfony style

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

It would be nice to have an info method as part of the SymfonyStyle class. This would prevent having to use the \<INFO\> tag, and it is consistent with other methods like warning and error (similar to the types available in monolog)

Commits
-------

4cf1a1e8e6 fixed docblock
204cd739d3 added info method to symfony style
2020-07-31 09:37:19 +02:00
Fabien Potencier
32941f22d1 feature #36691 [FrameworkBundle] Deprecate some public services to private (fancyweb)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate some public services to private

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

Now that we can deprecate public services to private, here is a first pass on the FWB. I think all those services don't need to be public, ie we never need to access them directly in Symfony's code (except in some tests that I had to modify accordingly). I think most of theses services needed to be public before we hooked the AbstractController with a service subscriber. There are definitely more of them that can be deprecated (ie: created workflows and state machines are public but don't need to be ?) but let's start with the easy ones.

Commits
-------

87868baacb [FrameworkBundle] Deprecate some public services to private
2020-07-31 09:12:35 +02:00
Fabien Potencier
5256323bbb feature #36929 Added a FrenchInflector for the String component (Alexandre-T)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Added a FrenchInflector for the String component

I read in [this blog post](https://symfony.com/blog/new-in-symfony-5-1-deprecated-the-inflector-component) this sentence

> Symfony Inflector component converts words between their singular and plural forms (**for now, only in English**)

So I created a FrenchInflector class implementing the InflectorInterface from the String component. This inflector uses regular expressions and it is tested in the FrenchInflectorTest with a lot of the french exceptions.

| Q             | A
| ------------- | ---
| Branch       | master
| Bug fix      | no
| New feature  | yes
| Deprecations | no
| License       | MIT
| Doc PR        | Not yet

Changelog has been updated, but I'm not sure I did it in the good paragraph.

I don't know if I should update the symfony/symfony-docs, but I have created an example and I could create a PR with it, if you want.

```php
<?php

use Symfony\Component\String\Inflector\FrenchInflector;

$inflector = new FrenchInflector();

$result = $inflector->singularize('dents');     // ['dent']
$result = $inflector->singularize('souris');    // ['souris']
$result = $inflector->singularize('messieurs'); // ['monsieur']

$result = $inflector->pluralize('cinquante'); // ['cinquante']
$result = $inflector->pluralize('pou');       // ['poux']
$result = $inflector->pluralize('cheval');    // ['chevaux']
```

**fabbot.io** is detecting a typo, but this is not. The patch done by fabpot suggests to replace the french 'embarras' word by 'embarrass'. I shall not remove or replace it, because "embarras" is an invariant word.

Commits
-------

d903d9a757 Added a FrenchInflector for the String component French inflector implements InflectorInterface, it uses regexp and it is tested in the FrenchInflectorTest
2020-07-31 09:11:18 +02:00
Fabien Potencier
909158bdb7 bug #37102 [WebProfilerBundle] Fix error with custom function and web profiler routing tab (JakeFr)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Fix error with custom function and web profiler routing tab

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36985
| License       | MIT
| Doc PR        | no

Here is a simple solution for #36985 as it only concerns WebProfilerBundle.

Due to the limitation in the routing tab as explained in the footnote, the route in my repo did not match in profiler (no query string in the new context) but there is no more syntax error.

Commits
-------

b35c81becb fix error with custom function and web profiler routing tab
2020-07-31 09:05:14 +02:00