Commit Graph

47862 Commits

Author SHA1 Message Date
Trevor North
971b177d27 Fix versioned namespace clears
When using namespace versioning to achieve atomic cache clears, only
delete cache keys matching the old/current version.

This resolves tag inconsistency issues whereby the process running the
clear would delete keys set against the new version by more recently
spawned concurreny processes. Most seriously this could result in newly
set data keys remaining, but with empty associated tag sets meaning the
invalidation via tags was no longer possible.

Clearing specific prefixes is not supported when using versioned
namespaces as it is desirable to clear all old keys as they will no
longer be used and would otherwise eventually fill cache memory.
2020-02-20 16:31:44 +00:00
Nicolas Grekas
7b1e4ea5e0 minor #35793 Use strict assertSame instead of assertEquals in Asset component tests (GromNaN)
This PR was merged into the 3.4 branch.

Discussion
----------

Use strict assertSame instead of assertEquals in Asset component tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/35762#discussion_r381400521
| License       | MIT
| Doc PR        | N/A

Using `assertSame` instead of `assertEquals` is recommended when possible (see https://github.com/sebastianbergmann/phpunit-documentation-english/issues/3). It is stricter and must be more efficient ([`===`](https://github.com/sebastianbergmann/phpunit/blob/8.5.2/src/Framework/Constraint/IsIdentical.php#L63) vs a [comparator class](https://github.com/sebastianbergmann/phpunit/blob/8.5.2/src/Framework/Constraint/IsEqual.php#L79)).

~~Also, removing useless string cast.~~

Commits
-------

e8f3e84959 Use strict assertion in asset tests
2020-02-20 14:39:53 +01:00
Robin Chalas
aa3637db6f bug #35792 [Security] Prevent TypeError in case RememberMetoken has no attached user (nikophil)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Prevent TypeError in case RememberMetoken has no attached user

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

Commits
-------

3515793cb3 fix remember me
2020-02-20 13:14:22 +01:00
Nicolas PHILIPPE
3515793cb3 fix remember me 2020-02-20 11:24:12 +01:00
Jérôme TAMARELLE
e8f3e84959 Use strict assertion in asset tests 2020-02-20 09:19:58 +01:00
Fabien Potencier
88b89c9b45 bug #35735 [Routing] Add locale requirement for localized routes (mtarld)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing] Add locale requirement for localized routes

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

4.4 version of https://github.com/symfony/symfony/pull/35692

If you're using localized routes, you expect to have these kind of routes available:
- `/fr/accueil`
- `/en/home`

But nowadays, these routes are unexpectedly available:
- `/en/accueil`
- `/fr/home`

When importing routes like that:
- `prefix: "/{_locale}"`
- `@Route({"en": "/home", "fr": "/accueil"}, name="home")`

This PR proposes to add a strict locale requirement for localized so that the above routes won't be available.

Commits
-------

50d744589e [Routing] Add locale requirement for localized routes
2020-02-20 09:00:36 +01:00
Thomas Calvet
018ec1ae5c [DoctrineBridge][DoctrineExtractor] Fix indexBy with custom and some core types 2020-02-19 23:15:50 +01:00
Nicolas Grekas
212841b3e6 bug #35772 [Config] don't throw on missing excluded paths (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] don't throw on missing excluded paths

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

Commits
-------

2f65a7a255 [Config] don't throw on missing excluded paths
2020-02-19 18:19:43 +01:00
Thomas Calvet
8dfb7b2ad1 [Validator] Add the divisibleBy option to the Count constraint 2020-02-19 17:59:38 +01:00
Nicolas Grekas
a81cbc99c7 bug #35774 [Ldap] force default network timeout (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Ldap] force default network timeout

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

The default network timeout is infinite, which makes no sense and can block workers.

Note that LDAP supports also "timelimit" options, but those are max-durations for LDAP queries. We cannot limit them by default.

Commits
-------

63f9e013a1 [Ldap] force default network timeout
2020-02-19 17:02:56 +01:00
Nicolas Grekas
7225a01bc6 minor #35786 Do not rely on the current locale when dumping a Graphviz object (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

Do not rely on the current locale when dumping a Graphviz object

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

---

Funny bug !

With `de_DE.UTF-8` as locale:
```
php > echo sprintf('%s', 0.5);
0,5
php > echo sprintf('%d', 0.5);
0
php > echo sprintf('%f', 0.5);
0,500000
php > echo (string) 0.5;
0,5
```

(so external tools like graphviz could not parse `0,5` - and so skipped the arrow)

So now we force `'0.5'`

/cc @OskarStark

Commits
-------

094e4bbbc2 Do not rely on the current locale when dumping a Graphviz object
2020-02-19 16:50:34 +01:00
Grégoire Pineau
094e4bbbc2 Do not rely on the current locale when dumping a Graphviz object
Funny bug !

With `de_DE.UTF-8` as locale:
```
php > echo sprintf('%s', 0.5);
0,5
php > echo sprintf('%d', 0.5);
0
php > echo sprintf('%f', 0.5);
0,500000
php > echo (string) 0.5;
0,5
```

So now we force `'0.5'`
2020-02-19 15:50:10 +01:00
Robin Chalas
1c24ccc635 fix typo 2020-02-18 22:48:57 +01:00
Fran Moreno
1cfaeec378 [String] Allow to keep the last word when truncating a text 2020-02-18 21:59:15 +01:00
Nicolas Grekas
63f9e013a1 [Ldap] force default network timeout 2020-02-18 14:07:02 +01:00
Fabien Potencier
bd42f129df minor #35770 [Notifier] Remove not needed argument $bus in BrowserChannel::notify(...) (jschaedl)
This PR was merged into the 5.0 branch.

Discussion
----------

[Notifier] Remove not needed argument $bus in BrowserChannel::notify(...)

| 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 #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

The `BrowserChannel::notify(...)` method defines a fourth nullable argument `$bus` which is not part of the `ChannelInterface` and also not used in the implementation. So I think it was added by mistake and can be removed.

Commits
-------

ab4123ce68 [Notifier] Remove not needed argument $bus in BrowserChannel::notify()
2020-02-18 13:28:21 +01:00
Jan Schädlich
ab4123ce68 [Notifier] Remove not needed argument $bus in BrowserChannel::notify() 2020-02-18 13:11:08 +01:00
Nicolas Grekas
2f65a7a255 [Config] don't throw on missing excluded paths 2020-02-18 12:18:14 +01:00
Fabien Potencier
cde44fcad1 minor #35768 Add the bug label automatically when using the bug issue template (stof)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Add the bug label automatically when using the bug issue template

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

Commits
-------

f2f9ee5466 Add the bug label automatically when using the bug issue template
2020-02-18 11:02:27 +01:00
Christophe Coevoet
f2f9ee5466
Add the bug label automatically when using the bug issue template 2020-02-18 10:35:58 +01:00
Fabien Potencier
5867c7e090 minor #35760 [Validator] Add the missing translations for the Polish ("pl") locale (przemyslaw-bogusz)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add the missing translations for the Polish ("pl") locale

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

Fabbot indicates a typo, but there is no typo. The English word `address` is `adres` in Polish (with a single d and a single s).

Commits
-------

8c4de564a8 [Validator] Add the missing translations for the Polish ("pl") locale
2020-02-18 09:09:42 +01:00
Fabien Potencier
baf4245203 bug #35764 [Messenger] Add missing return in AmazonSqsReceiver::getMessageCount (mynameisbogdan)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Add missing return in AmazonSqsReceiver::getMessageCount

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

Commits
-------

7042ff86ec [Messenger] Add missing return in AmazonSqsReceiver::getMessageCount
2020-02-18 09:08:26 +01:00
Bogdan
7042ff86ec [Messenger] Add missing return in AmazonSqsReceiver::getMessageCount 2020-02-18 02:58:50 +02:00
Robin Chalas
da2f885777 minor #35742 Docs: Typo, grammar (michaelKaefer)
This PR was submitted for the 5.0 branch but it was squashed and merged into the 3.4 branch instead (closes #35742).

Discussion
----------

Docs: Typo, grammar

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.4 or 5.0 for bug fixes <!-- see below -->
| Bug fix?      | yes/no
| New feature?  | yes/no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
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
-------

dc11c8d1b8 Docs: Typo, grammar
2020-02-17 20:21:44 +01:00
Michael Käfer
dc11c8d1b8 Docs: Typo, grammar 2020-02-17 20:21:37 +01:00
Przemysław Bogusz
8c4de564a8 [Validator] Add the missing translations for the Polish ("pl") locale 2020-02-17 20:16:57 +01:00
Fabien Potencier
2b68d53526 feature #34654 [Notifier] added Sinch texter transport (imiroslavov)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Notifier] added Sinch texter transport

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

This PR adds adapter for Sinch messaging gateway to the texter transport.

Example configuration:
`sinch://SID:TOKEN@default?from=PHONE`

Commits
-------

db6d360be8 [Notifier] added Sinch texter transport
2020-02-17 17:10:34 +01:00
Iliya Miroslavov Iliev
db6d360be8 [Notifier] added Sinch texter transport 2020-02-17 17:10:29 +01:00
Benjamin
771c642a43 [PhpUnitBridge] Add compatibility to PHPUnit 9 #35662 2020-02-17 09:30:34 +01:00
Jules Pietri
b25973cc2e
[Form] Added support for caching choice lists based on options 2020-02-16 16:50:19 +01:00
Mathias Arlaud
50d744589e [Routing] Add locale requirement for localized routes 2020-02-15 15:51:21 +01:00
Robin Chalas
334f0205d0 minor #35734 [Console] Inline exact-match handling with 4.4 (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Inline exact-match handling with 4.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/35696#issuecomment-585830029
| License       | MIT
| Doc PR        | -

This reduces the patch for #35696 (not released yet), inlining 3.4's code with 4.4 which was not impacted by the fixed bug. The reverted logic was useless starting from 4.4.
Thanks @stof for the hint.

Commits
-------

e13470c823 [Console] Inline exact-match handling with 4.4
2020-02-15 15:10:52 +01:00
Robin Chalas
e13470c823 [Console] Inline exact-match handling with 4.4 2020-02-15 14:27:16 +01:00
Nicolas Grekas
9acb06041c minor #35731 [Routing] marked configurators traits as internal (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Routing] marked configurators traits as internal

| 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       | Fix https://github.com/symfony/symfony/pull/30501#discussion_r376806342 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | not needed
<!--
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
-------

52efec76ad [Routing] marked configurators traits as internal
2020-02-15 11:42:33 +01:00
Nicolas Grekas
b92168c110 bug #35702 [VarDumper] fixed DateCaster not displaying additional fields (Makdessi Alex)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fixed DateCaster not displaying additional fields

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

----

Here's the result with [Holiday](https://github.com/azuyalabs/yasumi/blob/develop/src/Yasumi/Holiday.php) class

| before  | after
| ------- | -----
| ![before](https://user-images.githubusercontent.com/4425529/74445818-48f03d00-4e77-11ea-97e1-58d88ac52cba.png) | ![after](https://user-images.githubusercontent.com/4425529/74445825-4c83c400-4e77-11ea-8e8e-1fbbb1040438.png)

Commits
-------

f965971919 [VarDumper] fixed DateCaster not displaying additional fields
2020-02-15 11:39:34 +01:00
Nicolas Grekas
fcb833f26d minor #35717 time ( void ) : int (cbastienbaron)
This PR was merged into the 5.1-dev branch.

Discussion
----------

time ( void ) : int

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

no need to cast - micro improvement

Commits
-------

9f31581fd8 time ( void ) : int
2020-02-15 11:25:47 +01:00
bastien
9f31581fd8 time ( void ) : int
no need to cast
2020-02-15 11:25:26 +01:00
Jules Pietri
52efec76ad
[Routing] marked configurators traits as internal 2020-02-15 11:12:27 +01:00
Fabien Potencier
1a51d34d8c bug #35722 [HttpKernel] Set previous exception when rethrown from controller resolver (danut007ro)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[HttpKernel] Set previous exception when rethrown from controller resolver

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

If an `\InvalidArgumentException` is catched by ControllerResolver a new one is thrown. The old exception is not added as `previous` parameter on the new one so it is not visible on the exception page. This pull request adds old exception as previous on the new one, so it is also visible on the exception page.

Thank you.

Commits
-------

87d51c1e4b Set previous exception when rethrown from controller resolver
2020-02-15 08:21:47 +01:00
Daniel Gorgan
87d51c1e4b Set previous exception when rethrown from controller resolver 2020-02-15 08:21:39 +01:00
Fabien Potencier
12f1c7c4a3 minor #35713 Fixes typo in error message. (dbrumann)
This PR was merged into the 4.4 branch.

Discussion
----------

Fixes typo in error message.

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

Fixes a minor typo where the error message refers to the wrong argument.

Commits
-------

8f2fbf6e2c Fixes typo in error message.
2020-02-15 08:19:38 +01:00
Fabien Potencier
f4e9293734 bug #35714 [HttpClient] Correctly remove trace level options for HttpCache (aschempp)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Correctly remove trace level options for HttpCache

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

The `HttpCache` component allows to [configure a trace level](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L46). Due to the behavior of `CachingHttpClient`, options that are meant for the `HttpCache` must be unset before preparing the request. Currently these options can't be set, because `HttpClient` errors with invalid configuration options.

Commits
-------

618cd80b0d Correctly remove trace level options for HttpCache
2020-02-15 08:18:49 +01:00
Fabien Potencier
926e19ce32 bug #35718 [HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/35579#issuecomment-581653196
| License       | MIT
| Doc PR        | -

Commits
-------

3f995ac602 [HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI
2020-02-15 08:17:43 +01:00
Fabien Potencier
9697e9d241 bug #35728 Add missing autoload calls (greg0ire)
This PR was merged into the 4.4 branch.

Discussion
----------

Add missing autoload calls

Until either php 7.4 or doctrine/persistence 2 is required, these will
be needed to make sure php recognises signatures using the old names as
compatible with signatures using the new names.
This is necessary for types defined outside Symfony that extend types
from Symfony and still use the old names in signatures of methods they
override.

Fixes https://github.com/doctrine/DoctrineMongoDBBundle/issues/616

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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 https://github.com/doctrine/DoctrineMongoDBBundle/issues/616
| License       | MIT
| Doc PR        | n/a
<!--
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.
-->
This topic is fairly complicated, more details at https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf

Commits
-------

94b5dbde5a Add missing autoload calls
2020-02-15 08:16:17 +01:00
Grégoire Paris
94b5dbde5a
Add missing autoload calls
Until either php 7.4 or doctrine/persistence 2 is required, these will
be needed to make sure php recognises signatures using the old names as
compatible with signatures using the new names.
This is necessary for types defined outside Symfony that extend types
from Symfony and still use the old names in signatures of methods they
override.

More details at https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf

Fixes https://github.com/doctrine/DoctrineMongoDBBundle/issues/616
2020-02-14 19:45:19 +01:00
Nicolas Grekas
f46ab58bcf feature #35673 [Process] Add getter for process starttime (dompie)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Process] Add getter for process starttime

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | issue #35531
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Add a getter for process start time.

Commits
-------

3b9ed3e378 [Process] Add getter for process starttime
2020-02-14 14:09:35 +01:00
Dominik Piekarski
3b9ed3e378 [Process] Add getter for process starttime 2020-02-14 14:09:17 +01:00
Makdessi Alex
f965971919 [VarDumper] fixed DateCaster not displaying additional fields 2020-02-14 13:39:29 +01:00
Nicolas Grekas
3f995ac602 [HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI 2020-02-14 11:01:23 +01:00
Nicolas Grekas
0f46aa602a [Contracts] Add changelog entry for "symfony/deprecation-contracts" 2020-02-14 10:07:39 +01:00