Commit Graph

48854 Commits

Author SHA1 Message Date
Nicolas Grekas
f3529fd9df minor #40271 Switched to non-null defaults in exception constructors (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Switched to non-null defaults in exception constructors

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

PHP 8.1 will trigger a deprecation warning if we pass `null` as `$message` or `$code` to the constructor of `\Exception`. However, many of our own exception accept `null` for those parameters and even use them as default.

This is unfortunate because code like the following snippet would trigger that deprecation although the code itself is perfectly fine:

```php
throw new NotFoundHttpException();
```

With this PR, I'd like to change our defaults to `''` and `0` while still allowing to pass `null` for BC. In a follow-up PR for the 5.x branch, I'd like to deprecate passing `null`, matching the future behavior of PHP.

This PR also adjust various PHPDoc blocks with inaccurate types.

Commits
-------

f8e10094a4 Switched to non-null defaults in exception constructors
2021-02-22 16:37:04 +01:00
Alexander M. Turek
f8e10094a4 Switched to non-null defaults in exception constructors 2021-02-22 16:36:50 +01:00
Nicolas Grekas
070f003291 bug #40244 [Routing] fix conflict with param named class in attribute (nlhommet)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Routing] fix conflict with param named class in attribute

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

Fix conflict with AnnotationFileLoader and class PHP8 Attribute with param named "class"

Commits
-------

27bba684d8 [Routing] fix conflict with param named class in attribute
2021-02-22 16:26:26 +01:00
Nicolas LHommet
27bba684d8 [Routing] fix conflict with param named class in attribute 2021-02-22 16:26:18 +01:00
Nicolas Grekas
0027d1cd05 bug #40273 [Cache] fix setting items' metadata on commit() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] fix setting items' metadata on commit()

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

Commits
-------

9bb4b3106d [Cache] fix setting items' metadata on commit()
2021-02-22 15:52:02 +01:00
Nicolas Grekas
9bb4b3106d [Cache] fix setting items' metadata on commit() 2021-02-22 12:06:49 +01:00
Fabien Potencier
8054d1d04c bug #40258 [Form] Ignoring invalid forms from delete_empty behavior in CollectionType (yceruto)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Form] Ignoring invalid forms from delete_empty behavior in CollectionType

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

As expained on linked issue, empty forms cannot be removed if they are invalid upon submitting (e.g. transformation failures). Thus, form errors can be displayed properly to the end user.

Commits
-------

e4911554e3 [Form] Ignoring invalid forms from delete_empty behavior in CollectionType
2021-02-21 18:50:09 +01:00
Yonel Ceruto
e4911554e3 [Form] Ignoring invalid forms from delete_empty behavior in CollectionType 2021-02-21 18:50:02 +01:00
Fabien Potencier
bda90dfd2f minor #40223 Add Symfony Armenian Translations (ErikSaunier)
This PR was merged into the 4.4 branch.

Discussion
----------

Add Symfony Armenian Translations

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

Added missing armenian translations for Form components

Commits
-------

d1c3e21eff Add Symfony Armenian Translations
2021-02-21 18:47:22 +01:00
Nicolas Grekas
e15ac7ad97 minor #40253 [BrowserKit] Add different header notations to tests (malteschlueter)
This PR was merged into the 4.4 branch.

Discussion
----------

[BrowserKit] Add different header notations to tests

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

In the past there was a issue #29736 that the header wasn't processed correctly. To reproduce and prevent this behaviour i extended the tests for this. At the end everything is fine, also in 5.x branch. See bf03d6889d.

Commits
-------

251ce8f924 Add different header notations to tests
2021-02-20 18:06:12 +01:00
Erik Saunier
d1c3e21eff Add Symfony Armenian Translations 2021-02-19 18:17:03 +01:00
Nicolas Grekas
1329689ace cs fix 2021-02-19 10:48:50 +01:00
Nicolas Grekas
a7f12dab24 minor #40250 Stop using deprecated ArrayCache from Doctrine (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Stop using deprecated ArrayCache from Doctrine

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

Follows https://github.com/doctrine/cache/pull/355

Commits
-------

15f021f825 Stop using deprecated ArrayCache from Doctrine
2021-02-18 23:32:40 +01:00
Nicolas Grekas
15f021f825 Stop using deprecated ArrayCache from Doctrine 2021-02-18 23:27:55 +01:00
Malte Schlüter
251ce8f924 Add different header notations to tests 2021-02-18 11:52:56 +01:00
Nicolas Grekas
9765b5ab86 bug #40162 [Intl] fix Locale::getFallback() throwing exception on long $locale (AmirHo3ein13)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Intl] fix Locale::getFallback() throwing exception on long $locale

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

`Locale::getFallback()` throws an exception when the `$locale` length is greater than `INTL_MAX_LOCALE_LEN` so I added a condition to check if locale_parse return null, the `Locale::getFallback()` don't call `\count` function and just return null instead.

Commits
-------

a89ced8eac [Intl] fix Locale::getFallback() throwing exception on long $locale
2021-02-17 16:45:36 +01:00
bahram
a89ced8eac [Intl] fix Locale::getFallback() throwing exception on long $locale 2021-02-17 16:45:29 +01:00
Nyholm
1a5aec14d7
minor #40222 install compatible versions of mongodb/mongodb only (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

install compatible versions of mongodb/mongodb only

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

Commits
-------

3a231c2030 install compatible versions of mongodb/mongodb only
2021-02-17 16:05:42 +01:00
Christian Flothmann
3a231c2030 install compatible versions of mongodb/mongodb only 2021-02-17 15:20:29 +01:00
Nicolas Grekas
c1c20860e5 bug #40208 [PropertyInfo] fix resolving self to name of the analyzed class (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] fix resolving self to name of the analyzed class

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

Commits
-------

e9f2ece991 fix resolving parent/self/static type annotations
2021-02-16 13:45:38 +01:00
Christian Flothmann
e9f2ece991 fix resolving parent/self/static type annotations 2021-02-16 13:45:26 +01:00
Fabien Potencier
f8ce7d0803 bug #40209 [WebLink] Escape double quotes in attributes values (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebLink] Escape double quotes in attributes values

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

If the attribute value contains a double quote, the serialized value is invalid: `</foo>; rel="alternate"; title="foo " bar"`. Ideally we would use `addcslashes` but we can't because users that already pass escaped values would then be impacted.

Commits
-------

7946be2b95 [WebLink] Escape double quotes in attributes values
2021-02-16 13:01:27 +01:00
Robin Chalas
9230f69106 bug #40192 [Console] fix QuestionHelper::getHiddenResponse() not working with space in project directory name (Yendric)
This PR was submitted for the 5.2 branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

[Console] fix QuestionHelper::getHiddenResponse() not working with space in project directory name

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| 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 #40190 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Fixes #40190 to allow spaces in project directory name.

Commits
-------

0e421004eb [Console] fix QuestionHelper::getHiddenResponse() not working with space in project directory name
2021-02-16 12:16:11 +01:00
Yendric
0e421004eb [Console] fix QuestionHelper::getHiddenResponse() not working with space in project directory name 2021-02-16 12:16:02 +01:00
Thomas Calvet
7946be2b95 [WebLink] Escape double quotes in attributes values 2021-02-16 12:01:18 +01:00
Nicolas Grekas
08c789c97b minor #40206 Ignore indirect deprecation triggered by doctrine/orm (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Ignore indirect deprecation triggered by doctrine/orm

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

Commits
-------

8530ada94d Ignore indirect deprecation triggered by doctrine/orm
2021-02-16 10:46:56 +01:00
Nicolas Grekas
8530ada94d Ignore indirect deprecation triggered by doctrine/orm 2021-02-16 10:34:45 +01:00
Fabien Potencier
89d70970a9 minor #39809 Symfony Armenian Translations (azatyan, Nyholm)
This PR was submitted for the 5.x branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

Symfony Armenian Translations

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

Commits
-------

93fe4a213e Symfony Armenian Translations
2021-02-16 08:10:23 +01:00
Tigran Azatyan
93fe4a213e Symfony Armenian Translations 2021-02-16 08:10:14 +01:00
Fabien Potencier
1b358fef04 bug #40175 [PropertyInfo]  use the right context for properties defined in traits (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo]  use the right context for properties defined in traits

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

Commits
-------

1572491a8a use the right context for properties defined in traits
2021-02-16 07:44:52 +01:00
Fabien Potencier
aa21944d37 bug #40172 [Translation] Allow using dashes in locale when linting Xliff files (localheinz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Translation] Allow using dashes in locale when linting Xliff files

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

This pull request

* [x] asserts that the `XliffLintCommand` succeeds linting an Xliff file where both the the target language and the locale in the file name use dashes as separators
* [x] adjusts the `XliffLintCommand` to allow using the same value for target language and locale in the corresponding file name

Commits
-------

d106aa3f2d [Translation] Allow using dashes in locale when linting Xliff files
2021-02-16 07:36:55 +01:00
Andreas Möller
d106aa3f2d [Translation] Allow using dashes in locale when linting Xliff files 2021-02-16 07:36:48 +01:00
Christian Flothmann
4ee48c44e5 minor #40180 Fix: Article (localheinz)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix: Article

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

This pull request

* [x] fixes usages of the indefinite article `a` where `an` should be used instead

Commits
-------

34b320ba97 Fix: Article
2021-02-15 12:26:08 +01:00
Christian Flothmann
e62ef2adb7 bug #40187 [Console] Fix PHP 8.1 null error for preg_match flag (kylekatarnls)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fix PHP 8.1 null error for preg_match flag

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

Since PHP 8.1, `null` is no longer accepted as `$flags` in `preg_match`, default integer `0` value should be used instead.

Commits
-------

52f02e529a [Console] Fix PHP 8.1 null error for preg_match flag
2021-02-15 12:24:13 +01:00
Christian Flothmann
0574c1586a bug #39659 [Form] keep valid submitted choices when additional choices are submitted (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] keep valid submitted choices when additional choices are submitted

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

Commits
-------

85989c3678 keep valid submitted choices when additional choices are submitted
2021-02-15 12:22:00 +01:00
Alexander M. Turek
eab91556a6 bug #40188 [HttpFoundation] Fix PHP 8.1 null values (kylekatarnls)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Fix PHP 8.1 null values

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

Both `stripos` and `preg_match` will no longer accept `null` on PHP >= 8.1

Commits
-------

419e2206f4 Fix PHP 8.1 null values
2021-02-15 10:10:23 +01:00
Christian Flothmann
1572491a8a use the right context for properties defined in traits 2021-02-15 10:02:53 +01:00
Kyle
419e2206f4
Fix PHP 8.1 null values
Both `stripos` and `preg_match` will no longer accept `null` on PHP >= 8.1
2021-02-14 19:51:53 +01:00
Kyle
52f02e529a
[Console] Fix PHP 8.1 null error for preg_match flag
Since PHP 8.1, null is no longer accepted as $flags, default integer `0` value should be used instead.
2021-02-14 19:19:55 +01:00
Andreas Möller
34b320ba97
Fix: Article 2021-02-14 13:29:41 +01:00
Fabien Potencier
aad1d094a5 bug #40167 [DependencyInjection] Definition::removeMethodCall should remove all matching calls (ruudk)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead.

Discussion
----------

[DependencyInjection] Definition::removeMethodCall should remove all matching calls

It would only remove the first match, leaving the other method call(s) there to exist. This leads to unexpected situations.

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

I found out that `Definition::removeMethodCall` only removes the first method call and stops. It should remove all method calls named `$method`.

Commits
-------

944ba23b58 Definition::removeMethodCall should remove all matching calls
2021-02-14 12:22:38 +01:00
Ruud Kamphuis
944ba23b58 Definition::removeMethodCall should remove all matching calls
It would only remove the first match, leaving the other method call(s) there to exist. This leads to unexpected situations.
2021-02-14 12:22:33 +01:00
Fabien Potencier
4a32fd0446 bug #40160 [PropertyInfo] fix extracting mixed type-hinted property types (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] fix extracting mixed type-hinted property types

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

Commits
-------

be6432ee4c fix extracting mixed type-hinted property types
2021-02-14 11:36:42 +01:00
Fabien Potencier
4626100875 minor #40163 [Finder] mark the LazyIterator class as internal (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder] mark the LazyIterator class as internal

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/40040#discussion_r575127254
| License       | MIT
| Doc PR        |

Commits
-------

4a2c996b95 mark the LazyIterator class as internal
2021-02-12 16:34:00 +01:00
Christian Flothmann
4a2c996b95 mark the LazyIterator class as internal 2021-02-12 11:48:09 +01:00
Christian Flothmann
be6432ee4c fix extracting mixed type-hinted property types 2021-02-12 11:37:03 +01:00
Christian Flothmann
5fe91c9415 minor #40161 [Finder] add missing return type declaration (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder] add missing return type declaration

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

should make builds green again

Commits
-------

cfce9cbd59 add missing return type declaration
2021-02-12 11:36:44 +01:00
Christian Flothmann
cfce9cbd59 add missing return type declaration 2021-02-12 11:28:39 +01:00
Fabien Potencier
dc20a31179 bug #40040 [Finder] Use a lazyIterator to close files descriptors when no longer used (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder] Use a lazyIterator to close files descriptors when no longer used

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

The `RecursiveDirectoryIterator` class open the file on `__construct`.
Because we Inject an instance of `RecursiveDirectoryIterator` inside the \AppendIterator` class, php opens a lot of file even before iterating on it.

This PR adds a new `LazyIterator` class that instantiate the decorated class only when something starts iterating on it.
When the iteration is over, it unset the variable to close let the decorated class clean things (ie. close the files)

Commits
-------

7117e1a798 Use a lazyintertor to close files descriptors when no longer used
2021-02-12 08:28:15 +01:00
Fabien Potencier
79ccf88a2d minor #40157 Modernize func_get_args() calls to variadic parameters (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Modernize func_get_args() calls to variadic parameters

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

While reviewing #40143, I stumbled across the `Filesystem::box()` method and I felt like we could make the code look a little less PHP5-ish.

Commits
-------

5b536131f7 Modernize func_get_args() calls to variadic parameters
2021-02-12 08:13:15 +01:00