Commit Graph

50335 Commits

Author SHA1 Message Date
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
Fabien Potencier
281a7522dc minor #37538 Add the name of the env to RuntimeException (Simon Frost)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Add the name of the env to RuntimeException

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

if you have the name of the env in the exception message it is much easier to find the error

from -> https://github.com/symfony/dependency-injection/pull/20

Commits
-------

00ab757cbb Add the name of the env to RuntimeException
2020-07-31 08:57:38 +02:00
Simon Frost
00ab757cbb Add the name of the env to RuntimeException 2020-07-31 08:57:33 +02:00
Fabien Potencier
4c40ff8392 Fix typo 2020-07-31 08:55:54 +02:00
Fabien Potencier
203ed71ec1 minor #37542 [Mailer] Updated README for the Mailer component (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Updated README for the Mailer component

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs#13945

I think it's worth adding a second example showcasing the twig integration for 2 reasons:

* If you're used to use this component in the framework, I think it's likely you want Twig integration in standalone apps.
* The integration actually lives in `symfony/twig-bridge`, it won't be very easy to catch while reading the component code - unless you're very comfortable with the Symfony architecture.

Commits
-------

696560c690 Updated README for the Mailer component
2020-07-31 08:54:29 +02:00
Fabien Potencier
bea431935f bug #37560 [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account (Jeroeny)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account

| Q             | A
| ------------- | ---
| Branch?       |  4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/37424
| License       | MIT

The new regex is made per positive `.gitignore` line. Which is a match group followed by a negative lookbehind with all the negations that were on lines after that line. This also fixes some other bugs that didn't match the `.gitignore` spec and two incorrect tests. I think it's likely that there are more edge cases this PR may not cover, but I haven't found them yet.

See the issue for more info.

Commits
-------

609dcf6b08 [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account
2020-07-31 08:51:39 +02:00
Jeroeny
609dcf6b08 [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account 2020-07-31 08:51:32 +02:00
Fabien Potencier
374d70568c feature #37620 [Security] Use NullToken while checking authorization (wouterj)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Use NullToken while checking authorization

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

This allows voters to grant access to unauthenticated users. E.g. some objects can be viewed by anyone, in this case the voter has to be able to grant access to unauthenticated users.

This *does break* the interface PHPdoc of `TokenInterface`: `getUser()` returns `null` instead of `string|UserInterface`. This is only true when using the new system, so not a real BC break. I think the only thing we can do to "guide" users is to add some custom handling for type errors related to `null` and `UserInterface` methods ("Did you forgot to check for `null` in the Voter?"). Is this something I should add to this PR?

Commits
-------

e37091541c Use NullToken while checking authorization
2020-07-31 08:44:47 +02:00
Fabien Potencier
b940b5a4ca bug #37700 [VarDumper] Improve previous fix on light array coloration (l-vo)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] Improve previous fix on light array coloration

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

Improve #36230 to fix #37674 (revert previous fix and use a solution that looks better).

Commits
-------

cef16f591f [VarDumper] Improve previous fix on light array coloration
2020-07-31 08:39:36 +02:00
Fabien Potencier
bd591057e4 feature #37711 [Router] allow to use \A and \z as regex start and end (zlodes)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Router] allow to use \A and \z as regex start and end

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

Some people are using `\A` and `\z` as alternative for `^` and `$` for route requirements.

E.g.: UUID pattern in ramsey/uuid (many routes broke after updating the lib):
569e93ac4e (diff-23c8536f7d61e7d839fd1c93ce0dd354L30-R31)

References:
https://www.rexegg.com/regex-anchors.html#A
https://www.rexegg.com/regex-anchors.html#z

P.S.: It is my first PR into Symfony. Maybe I should fix something, just let me know.

Commits
-------

f752eeeaa6 [Router] allow to use \A and \z as regex start and end
2020-07-31 08:30:16 +02:00
Zlatoslav Desyatnikov
f752eeeaa6 [Router] allow to use \A and \z as regex start and end 2020-07-31 08:30:09 +02:00
Fabien Potencier
bfc0351da6 bug #37654 [Messenger] Fix invalid option sslmode in AmazonSqs bridge (jderusse)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] Fix invalid option sslmode in AmazonSqs bridge

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

The sslmode option allows people to use AmazonSqs with non-offical endpoint like the [asyncaws/testing-sqs](https://hub.docker.com/r/asyncaws/testing-sqs) docker image

By fixing precedence of DNS options in https://github.com/symfony/symfony/pull/37269 I introduced a bug that trigger an exception `Unknown option found: [sslmode]`. I apologize for this

This PR adds `sslmode` in list of allowed options

Commits
-------

afbd51b368 Fix invalid option sslmode
2020-07-31 08:25:05 +02:00
Fabien Potencier
13a5e47b97 feature #37703 Update StopwatchPeriod.php (ThomasLandauer)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Update StopwatchPeriod.php

Adding `__toString()`, analogous to [`StopwatchEvent`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Stopwatch/StopwatchEvent.php#L242)

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

Commits
-------

d3c2911f46 Update StopwatchPeriod.php
2020-07-31 08:22:10 +02:00
Thomas Landauer
d3c2911f46 Update StopwatchPeriod.php 2020-07-31 08:22:04 +02:00
Fabien Potencier
79bc5b7001 bug #37687 Fix getTranslationNodeVisitor() return type (dbrekelmans)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Fix getTranslationNodeVisitor() return type

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

When constructing the `TranslationExtension` with any `NodeVisitorInterface` other than `TranslationNodeVisitor`, you will get a type error when calling `getTranslationNodeVisitor()`. This PR fixes that by extracting a new `TranslationNodeVisitorInterface`.

Commits
-------

c1344257f1 Fix getTranslationNodeVisitor() return type
2020-07-31 08:20:27 +02:00
dbrekelmans
c1344257f1 Fix getTranslationNodeVisitor() return type 2020-07-31 07:47:48 +02:00
Fabien Potencier
e69b8b1473 bug #37705 [Mailer] Added the missing reset tag to mailer.logger_message_listener (vudaltsov)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Added the missing reset tag to mailer.logger_message_listener

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

Commits
-------

4e089b411c Added the missing reset tag to mailer.logger_message_listener
2020-07-30 13:10:09 +02:00
Fabien Potencier
e411c96718 feature #37696 [Routing] Allow inline definition of requirements and defaults for host (julienfalque)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Routing] Allow inline definition of requirements and defaults for host

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

This PR extends the support of inline routing requirements and defaults to the host part, which can also contain parameters.

Commits
-------

1501476d52 [Routing] Allow inline definition of requirements and defaults for host
2020-07-30 10:44:46 +02:00
Fabien Potencier
de1fb0acb4 minor #37682 Update UPGRADE-5.0.md (noniagriconomie)
This PR was submitted for the 5.0 branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

Update UPGRADE-5.0.md

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | https://symfony.com/doc/4.4/setup/built_in_web_server.html

Small improvement

Commits
-------

83338b4a00 Update UPGRADE-5.0.md
2020-07-30 10:43:42 +02:00
Antoine Makdessi
83338b4a00 Update UPGRADE-5.0.md 2020-07-30 10:43:32 +02:00
vudaltsov
4e089b411c Added the missing reset tag to mailer.logger_message_listener 2020-07-29 20:46:22 +03:00
Julien Falque
1501476d52
[Routing] Allow inline definition of requirements and defaults for host 2020-07-29 18:19:41 +02:00
Laurent VOULLEMIER
cef16f591f [VarDumper] Improve previous fix on light array coloration 2020-07-29 17:09:23 +02:00
Nicolas Grekas
e983035e1a Merge branch '5.1'
* 5.1:
  reduce column length for MySQL 5.6 compatibility
  Minor improvement
  Removed redundant strtolower in ConsumeMessagesCommand
  getContainer cannot return null anymore
  HttpClient profiler error
  Fix RedisStore constructor signature
  Bump Symfony version to 5.1.4
  Update VERSION for 5.1.3
  Update CHANGELOG for 5.1.3
  Bump Symfony version to 4.4.12
  Update VERSION for 4.4.11
  Update CHANGELOG for 4.4.11
  Bump Symfony version to 3.4.44
  updated VERSION for 3.4.43
  update CONTRIBUTORS for 3.4.43
  updated CHANGELOG for 3.4.43
  Fix author for class CachePoolClearerCacheWarmer
2020-07-29 16:54:40 +02:00
Nicolas Grekas
f03a4b37b3 minor #37517 Fix author for class CachePoolClearerCacheWarmer (guilliamxavier)
This PR was merged into the 5.1 branch.

Discussion
----------

Fix author for class CachePoolClearerCacheWarmer

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/35109#discussion_r363985644
| License       | MIT
| Doc PR        | symfony/symfony-docs#...

Commits
-------

b3d0812976 Fix author for class CachePoolClearerCacheWarmer
2020-07-29 16:52:17 +02:00
Nicolas Grekas
ffa50acd3a Merge branch '4.4' into 5.1
* 4.4:
  reduce column length for MySQL 5.6 compatibility
  Minor improvement
  Removed redundant strtolower in ConsumeMessagesCommand
  Fix RedisStore constructor signature
  Bump Symfony version to 4.4.12
  Update VERSION for 4.4.11
  Update CHANGELOG for 4.4.11
  Bump Symfony version to 3.4.44
  updated VERSION for 3.4.43
  update CONTRIBUTORS for 3.4.43
  updated CHANGELOG for 3.4.43
2020-07-29 16:51:18 +02:00
Nicolas Grekas
b6ea86e7a2 bug #37697 [Messenger] reduce column length for MySQL 5.6 compatibility (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] reduce column length for MySQL 5.6 compatibility

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

Commits
-------

bc5f35c609 reduce column length for MySQL 5.6 compatibility
2020-07-29 16:49:14 +02:00
Nicolas Grekas
fbcef6e1e2 [Contracts] remove version in composer.json 2020-07-29 16:46:19 +02:00
Christian Flothmann
bc5f35c609 reduce column length for MySQL 5.6 compatibility 2020-07-29 10:26:17 +02:00
Fabien Potencier
2ee10004c9 bug #37690 HttpClient profiler error (noniagriconomie)
This PR was merged into the 5.1 branch.

Discussion
----------

HttpClient profiler error

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

When no error occurs making http request, the span was red, it is wierd

Commits
-------

5199f1f9f3 HttpClient profiler error
2020-07-29 07:58:54 +02:00
Fabien Potencier
cc827466bb minor #37688 Minor improvement (noniagriconomie)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Minor improvement

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

Related to https://symfony.com/releases

Commits
-------

e80dfe7c67 Minor improvement
2020-07-29 07:57:56 +02:00
Antoine Makdessi
e80dfe7c67 Minor improvement 2020-07-29 07:57:47 +02:00
Fabien Potencier
600e5d1219 minor #37693 Removed redundant strtolower in ConsumeMessagesCommand (vudaltsov)
This PR was merged into the 4.4 branch.

Discussion
----------

Removed redundant strtolower in ConsumeMessagesCommand

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

Commits
-------

e288834cda Removed redundant strtolower in ConsumeMessagesCommand
2020-07-29 07:55:08 +02:00
Fabien Potencier
c931d073a4 minor #37692 KernelBrowser::getContainer cannot return null anymore (VincentLanglet)
This PR was merged into the 5.1 branch.

Discussion
----------

KernelBrowser::getContainer cannot return null anymore

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

This is a pedantic change.

In symfony 4.4, getContainer could return null.
Since symfony 5.0, this is the implementation:
```
    public function getContainer()
    {
        if (!$this->container) {
            throw new \LogicException('Cannot retrieve the container from a non-booted kernel.');
        }

        return $this->container;
    }
```

So I updated the phpdoc.

Commits
-------

257549e9c8 getContainer cannot return null anymore
2020-07-29 07:54:25 +02:00
Valentin Udaltsov
e288834cda
Removed redundant strtolower in ConsumeMessagesCommand 2020-07-29 04:50:45 +03:00
Vincent Langlet
257549e9c8 getContainer cannot return null anymore 2020-07-29 00:26:06 +02:00
noniagriconomie
5199f1f9f3 HttpClient profiler error 2020-07-28 22:37:51 +02:00
Christophe Coevoet
84a4c4db97 minor #37675 Fix RedisStore constructor signature (b1rdex)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix RedisStore constructor signature

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

This is a fix for a regression from #37590

Commits
-------

6831271feb Fix RedisStore constructor signature
2020-07-27 11:31:10 +02:00
Anatoly Pashin
6831271feb
Fix RedisStore constructor signature
This is a fix for a regression from #37590
2020-07-27 11:39:16 +10:00
Philipp Kolesnikov
bdec105a72 [Cache] Fix #37667 2020-07-26 15:13:16 +10:00
Matthias Dötsch
0d36c11f28 [EventDispatcher] Avoid not needed null check in dispatch() 2020-07-25 23:01:31 +02:00
Jérémy Derussé
afbd51b368
Fix invalid option sslmode 2020-07-24 13:53:49 +02:00
Fabien Potencier
fd6181c8b5 Bump Symfony version to 5.1.4 2020-07-24 06:28:10 +02:00
Fabien Potencier
753a0728e9
Merge pull request #37650 from fabpot/release-5.1.3
released v5.1.3
2020-07-24 06:23:17 +02:00