Commit Graph

45323 Commits

Author SHA1 Message Date
Jakub Zalas
25461b358c Skip the intl notice if run with phpunit 2019-10-07 10:06:23 +02:00
Nicolas Grekas
d2f81998c0 minor #33865 Remove a test brought back with a merge (jakzal)
This PR was merged into the 5.0-dev branch.

Discussion
----------

Remove a test brought back with a merge

re #33790

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

Commits
-------

011ddfc502 Remove a test brought back with a merge
2019-10-04 23:41:01 +02:00
Jakub Zalas
011ddfc502
Remove a test brought back with a merge
re #33790
2019-10-04 23:27:17 +02:00
Nicolas Grekas
d9ca86e7fd minor #33825 [FrameworkBundle] encourage installing intl when String is available (nicolas-grekas)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[FrameworkBundle] encourage installing intl when String is available

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

Commits
-------

215595be5a [FrameworkBundle] encourage installing intl when String is available
2019-10-04 09:50:57 +02:00
Nicolas Grekas
215595be5a [FrameworkBundle] encourage installing intl when String is available 2019-10-04 09:49:39 +02:00
Nicolas Grekas
35f319caeb minor #33824 [WebProfilerBundle] Fix TemplateManager test (fancyweb)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[WebProfilerBundle] Fix TemplateManager test

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

Commits
-------

d1ed9685e1 [WebProfilerBundle] Fix TemplateManager test
2019-10-03 09:46:52 +02:00
Thomas Calvet
d1ed9685e1 [WebProfilerBundle] Fix TemplateManager test 2019-10-03 09:40:48 +02:00
Nicolas Grekas
ebda9d1ae7 minor #33808 [Console] Throw a TypeError for non-int return value calling Command::execute() (jschaedl)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Console] Throw a TypeError for non-int return value calling Command::execute()

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33747 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

### Todo

- [x] needs to be rebased after 4.4 was merged into master (see: https://github.com/symfony/symfony/pull/33805)

Commits
-------

b3a3b0c235 [Console] Throw a TypeError for non-int return values on calling Command::execute()
2019-10-02 19:22:46 +02:00
Jan Schädlich
b3a3b0c235 [Console] Throw a TypeError for non-int return values on calling Command::execute() 2019-10-02 19:22:19 +02:00
Nicolas Grekas
95ebca5213 Merge branch '4.4'
* 4.4:
  fix typo
2019-10-02 19:19:42 +02:00
Nicolas Grekas
3b1655165e fix typo 2019-10-02 19:19:36 +02:00
Nicolas Grekas
1e4d873c13 feature #33768 [String] Introduce a locale-aware Slugger in the String component (tgalopin)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] Introduce a locale-aware Slugger in the String component

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

This PR introduces a locale-aware Slugger in the new String component, based on transliterators provided by the PHP intl extension (or iconv if not available). It also wires this Slugger in the FrameworkBundle in order to use it easily as a service and to automatically inject the proper locale into it to choose the appropriate transliteration depending on the Request locale.

See https://github.com/unicode-org/cldr/tree/master/common/transforms for CLDR mappings.

Commits
-------

056d8ceed9 [String] Introduce a locale-aware Slugger in the String component with FrameworkBundle wiring
2019-10-02 18:39:31 +02:00
Titouan Galopin
056d8ceed9 [String] Introduce a locale-aware Slugger in the String component with FrameworkBundle wiring 2019-10-02 18:31:43 +02:00
Nicolas Grekas
4a547c5663 bug #33815 [Workflow] Fixed default marking store value of Workflow (lyrixx)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Workflow] Fixed default marking store value of Workflow

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

Commits
-------

a2330b7a90 [Workflow] Fixed default marking store value of Workflow
2019-10-02 18:13:01 +02:00
Nicolas Grekas
7db04f1248 Merge branch '4.4'
* 4.4:
  fix merge
2019-10-02 18:10:14 +02:00
Grégoire Pineau
a2330b7a90 [Workflow] Fixed default marking store value of Workflow 2019-10-02 17:57:26 +02:00
Nicolas Grekas
d7e5dd120b Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-10-02 17:04:54 +02:00
Nicolas Grekas
766162c4c7 fix merge 2019-10-02 17:03:35 +02:00
Nicolas Grekas
3ee9dbd17b Merge branch '4.4'
* 4.4: (24 commits)
  [Console] Command::execute() should always return int - deprecate returning null
  [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
  [AnnotationCacheWarmer] add RedirectController to annotation cache
  [WebProfilerBundle] Try to display the most useful panel by default
  Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide
  fix merge
  [DI] add tests loading calls with returns-clone
  [DI] dont mandate a class on inline services with a factory
  Fixed Redis Sentinel usage when only one Sentinel specified
  [EventDispatcher] Added tests for aliased events.
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant
  [Mailer] Tweak some code
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [WebserverBundle] Remove duplicated deprecation message
  remove duplicated test
  [Security/Http] fix parsing X509 emailAddress
  [FrameworkBundle] conflict with VarDumper < 4.4
  ...
2019-10-02 17:00:37 +02:00
Nicolas Grekas
c2111be180 feature #33775 [Console] Add deprecation message for non-int statusCode (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Add deprecation message for non-int statusCode

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33747 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

### What was done:

- [x] added deprecation message for non-int return value in Command::execute()
- [x] fixed all core commands to return proper int values
- [x] added proper return type-hint to Command::execute() method in all core Commands

Commits
-------

98c4f6a06c [Console] Command::execute() should always return int - deprecate returning null
2019-10-02 16:45:52 +02:00
Jan Schädlich
98c4f6a06c [Console] Command::execute() should always return int - deprecate returning null
- added deprecation message for non-int return value in Command::execute()
- fixed all core commands to return proper int values
- added proper return type-hint to Command::execute() method in all core Commands
2019-10-02 16:44:58 +02:00
Nicolas Grekas
3354bacc02 Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
  [AnnotationCacheWarmer] add RedirectController to annotation cache
  [DI] add tests loading calls with returns-clone
  [EventDispatcher] Added tests for aliased events.
  [DI] Add CSV env var processor tests
2019-10-02 16:41:32 +02:00
Nicolas Grekas
bf62544a0c Merge branch '3.4' into 4.3
* 3.4:
  [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
  [AnnotationCacheWarmer] add RedirectController to annotation cache
2019-10-02 16:38:26 +02:00
Nicolas Grekas
1fea53330d bug #33744 [DI] Add CSV env var processor tests / support PHP 7.4 (ro0NL)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Add CSV env var processor tests / support PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Similar as #32051

Commits
-------

82f341864c [DI] Add CSV env var processor tests
2019-10-02 14:58:58 +02:00
Nicolas Grekas
69928be76e minor #33795 [EventDispatcher] Added tests for aliased events (derrabus)
This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] Added tests for aliased events

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

While working on #33793 I discovered that I could remove the event alias feature of `RegisterListenersPass` without breaking the component's tests. This PR adds the missing tests.

Commits
-------

8e8a6ed99b [EventDispatcher] Added tests for aliased events.
2019-10-02 14:57:27 +02:00
Nicolas Grekas
badb656f62 minor #33801 [DI] add tests loading calls with returns-clone (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] add tests loading calls with returns-clone

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

Commits
-------

9a48def0c0 [DI] add tests loading calls with returns-clone
2019-10-02 14:55:34 +02:00
Nicolas Grekas
00792fc778 minor #33788 [Serializer] Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant (pierredup)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Serializer] Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | not really
| Deprecations? | yes (well, sort of)
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

There is a small typo in the `XmlEncoder` constant. This can only be fixed in the master branch for Symfony 5 as it is a breaking change. I'm not sure if it's possible to deprecate the usage of the old constant name in 4.4? As the constant just resolves to a string, there is no way of determining if someone used the constant or not (a quick search on Github, I can't find any direct usages of the constant outside of this class)

Commits
-------

001d0f1693 Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant
2019-10-02 14:42:21 +02:00
Nicolas Grekas
4d6fe5ce5d feature #33783 [WebProfilerBundle] Try to display the most useful panel by default (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Try to display the most useful panel by default

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

Alternative to https://github.com/symfony/symfony/pull/32491, the goal stays the same.

I think reserving a data collector name is fine, isn'it ? It's not likely that end users use this name (that's why I added an underscore) + shouldn't be hard for them to just rename it.

I don't think adding a configuration option to toggle the "_best" behavior is useful, should be by default for DX IMHO.

Not adding an extension point for now (for end users to set their panel as the "best"), maybe later if someone request it?

Commits
-------

a45dd98b73 [WebProfilerBundle] Try to display the most useful panel by default
2019-10-02 14:22:29 +02:00
Christian Flothmann
fb5f8fb96a bug #33805 [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand (jschaedl)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33747<!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

This is a follow-up PR caused by https://github.com/symfony/symfony/pull/33775#discussion_r330463216

Commits
-------

9b5ced20bb [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
2019-10-02 14:13:41 +02:00
Nicolas Grekas
a176d1a928 bug #33807 [String] fix toAscii() (nicolas-grekas)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] fix toAscii()

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

Commits
-------

46a23f87d9 [String] fix toAscii()
2019-10-02 14:13:38 +02:00
Nicolas Grekas
46a23f87d9 [String] fix toAscii() 2019-10-02 14:01:44 +02:00
Jan Schädlich
9b5ced20bb [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand 2019-10-02 12:47:49 +02:00
Nicolas Grekas
db9ef8ae17 bug #33781 [AnnotationCacheWarmer] add RedirectController to annotation cache (jenschude)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #33781).

Discussion
----------

[AnnotationCacheWarmer] add RedirectController to annotation cache

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #29357
| License       | MIT

This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems

Commits
-------

6b6c246c72 [AnnotationCacheWarmer] add RedirectController to annotation cache
2019-10-02 11:29:22 +02:00
Jens Schulze
6b6c246c72 [AnnotationCacheWarmer] add RedirectController to annotation cache
This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems

See #29357
2019-10-02 11:29:04 +02:00
Nicolas Grekas
e3aed1055d minor #33782 [DI] dont mandate a class on inline services with a factory (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] dont mandate a class on inline services with a factory

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

This check is too strict, useless and boring for inline services :)

Commits
-------

a2665d17cd [DI] dont mandate a class on inline services with a factory
2019-10-02 11:23:07 +02:00
Nicolas Grekas
e04cf9155e minor #33803 [Serializer] Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in upgrade (pierredup)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in upgrade

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | N/A
| New feature?  | N/A
| Deprecations? | N/A
| Tickets       | https://github.com/symfony/symfony/pull/33789#issuecomment-537392407
| License       | MIT
| Doc PR        | N/A

Commits
-------

b4de582c18 Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide
2019-10-02 11:19:55 +02:00
Pierre du Plessis
001d0f1693
Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant 2019-10-02 11:18:51 +02:00
Thomas Calvet
a45dd98b73 [WebProfilerBundle] Try to display the most useful panel by default 2019-10-02 11:17:11 +02:00
Nicolas Grekas
41e452a906 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-10-02 11:13:07 +02:00
Pierre du Plessis
b4de582c18
Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide 2019-10-02 11:08:22 +02:00
Nicolas Grekas
e490db8834 fix merge 2019-10-02 11:05:24 +02:00
Nicolas Grekas
d4f3b685df Merge branch '4.3' into 4.4
* 4.3:
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [Security/Http] fix parsing X509 emailAddress
  [Serializer] fix denormalization of string-arrays with only one element #33731
  [Cache] fix known tag versions ttl check
2019-10-02 10:48:21 +02:00
Nicolas Grekas
b628210df7 Merge branch '3.4' into 4.3
* 3.4:
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [Security/Http] fix parsing X509 emailAddress
  [Serializer] fix denormalization of string-arrays with only one element #33731
  [Cache] fix known tag versions ttl check
2019-10-02 10:36:26 +02:00
Nicolas Grekas
ff194d9844 minor #33792 Sync Twig templateExists behaviors (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Sync Twig templateExists behaviors

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

There are 5 places in the code that does the same check, but they are not consistent. The difficulty here is to support Twig 1, 2 & 3. I think relying on `Environment::MAJOR_VERSION` is OK. `method_exists` are useless IMO. The proof is that they are currenty missing in some of them.

Basically if Twig >= 2 -> the method `exists` exists on the loader so just call it.

For Twig 1, check `ExistsLoaderInterface`, then check for `SourceContextLoaderInterface`, then call `getSource()`.

Commits
-------

d7682fee6c Sync Twig templateExists behaviors
2019-10-02 10:32:14 +02:00
Fabien Potencier
7020f2602b bug #33797 [Cache] Fixed Redis Sentinel usage when only one Sentinel specified (Rohaq)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Fixed Redis Sentinel usage when only one Sentinel specified

Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.

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

As from Issue #33796
In a Redis Sentinel setup, if only a single Redis Sentinel, or multiple Sentinels with the same host/port are specified (as we're currently doing in a test environment), then the call to `setSentinelTimeout` in `RedisTrait.php` throws an exception, as the wrong interface appears to be initialised as a result.

Adding a check for the `redis_sentinel` parameter, as was done with a check for the `redis_cluster` parameter, avoids this, and the Redis Client is initialised correctly.

Commits
-------

13233fcd8e Fixed Redis Sentinel usage when only one Sentinel specified
2019-10-02 10:31:34 +02:00
Nicolas Grekas
564a65732a bug #33798 [String] fix beforeLast/afterLast (gharlan)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] fix beforeLast/afterLast

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

```php
echo b('hello world')->beforeLast('hello', true);
// current result: ''
// expected result: 'hello'

echo b('hello world')->afterLast('hello');
// current result: ''
// expected result: ' world'
```

Commits
-------

80b4f81ebf [String] fix beforeLast/afterLast
2019-10-02 10:13:56 +02:00
Fabien Potencier
526fd9fc44 feature #33701 [HttpKernel] wrap compilation of the container in an opportunistic lock (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] wrap compilation of the container in an opportunistic lock

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

https://github.com/symfony/symfony/pull/32764#issuecomment-516924305

This PR adds a lock around the compilation of the container. When two or more concurrent requests want to compile the container, the first one runs the computation and the others wait for its completion. If for any reasons the lock doesn't work, compilation happens as usual.

The effect is visible when developing locally:

Here is what all concurrent requests consume now:
![image](https://user-images.githubusercontent.com/243674/65603626-4e231d00-dfa6-11e9-8b6c-62dbd5eb30fe.png)

And here is what they will consume with this PR (they wait but reuse the just compiled container):
![image](https://user-images.githubusercontent.com/243674/65603733-7f9be880-dfa6-11e9-930b-ce793c3e280c.png)

Commits
-------

0b5b3ed7f9 [HttpKernel] wrap compilation of the container in an opportunistic lock
2019-10-02 10:09:14 +02:00
Nicolas Grekas
9a48def0c0 [DI] add tests loading calls with returns-clone 2019-10-02 10:03:02 +02:00
Nicolas Grekas
a2665d17cd [DI] dont mandate a class on inline services with a factory 2019-10-02 09:19:13 +02:00
Gregor Harlan
80b4f81ebf
[String] fix beforeLast/afterLast 2019-10-01 20:07:29 +02:00