Commit Graph

53489 Commits

Author SHA1 Message Date
Fabien Potencier
e2b1d9cd5a feature #39399 [Serializer] Allow to provide (de)normalization context in mapping (ogizanagi)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Serializer] Allow to provide (de)normalization context in mapping

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

As explained in the linked feature request, this brings the ability to configure context on a per-property basis, using Serializer mapping.

Considering:

```php
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;

class Foo
{
    /**
     * @Serializer\Context({ DateTimeNormalizer::FORMAT_KEY = 'Y-m-d' })
     */
    public \DateTime $date;

    public \DateTime $anotherDate;
}
```

`$date` will be formatted with a specific format, while `$anotherDate` will use the default configured one (or the one provided in the context while calling `->serialize()` / `->normalize()`).

It can also differentiate normalization and denormalization contexts:

```php
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;

class Foo
{
    /**
     * @Serializer\Context(
     *   normalizationContext = { DateTimeNormalizer::FORMAT_KEY = 'Y-m-d' },
     *   denormalizationContext = { DateTimeNormalizer::FORMAT_KEY = \DateTime::COOKIE },
     * )
     */
    public \DateTime $date;
}
```

As well as act differently depending on groups:

```php
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;

class Foo
{
    /**
     * @Serializer\Groups({ "extended" })
     * @Serializer\Context({ DateTimeNormalizer::FORMAT_KEY = \DateTime::RFC3339 })
     * @Serializer\Context(
     *   context = { DateTimeNormalizer::FORMAT_KEY = \DateTime::RFC3339_EXTENDED },
     *   groups = {"extended"},
     * )
     */
    public \DateTime $date;
}
```

The annotation can be repeated as much as you want to handle the different cases.
Context without groups is always applied first, then context for groups are merged in the provided order.
Context provided when calling `->serialize()` / `->normalize()` acts as the defaults for the properties without context provided in the metadata.

XML mapping (see tests) is a lot verbose due to the required structure to handle groups.

Such metadata contexts are also forwarded to name converters, max depth handlers, callbacks, ...

Of course, PHP 8 attributes are also supported:

```php
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;

class Foo
{
    #[Serializer\Groups(["extended"])]
    #[Serializer\Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
    #[Serializer\Context(
      context: [DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339_EXTENDED],
      groups: ["extended"],
    )]
    public \DateTime $date;
}
```

The PR should be ready for first batch of reviews / discussions.

- [x] Make Fabbot happy in 5.2
- [x] Missing `@Context` unit tests
- [x] rework xml & phpize values
- [x] Fix lowest build issue with annotations => bumped doctrine annotations to 1.7, as for other components

Commits
-------

7229fa1d8f [Serializer] Allow to provide (de)normalization context in mapping
2021-02-16 07:56:07 +01:00
Maxime Steinhausser
7229fa1d8f [Serializer] Allow to provide (de)normalization context in mapping 2021-02-16 07:56:01 +01:00
Robin Chalas
a4c5edc5ff Merge branch '5.2' into 5.x
* 5.2:
  [Workflow] Re-add InvalidTokenConfigurationException for BC
  Fix PHP 8.1 null values
  [Console] Fix PHP 8.1 null error for preg_match flag
  Fix: Article
  Definition::removeMethodCall should remove all matching calls
  [HttpFoundation] Fix typo in exception message
  mark the LazyIterator class as internal
  fix extracting mixed type-hinted property types
  [Worflow] Fixed GuardListener when using the new Security system
  keep valid submitted choices when additional choices are submitted
2021-02-15 19:57:44 +01:00
Robin Chalas
4365af6ce8 Merge branch '4.4' into 5.2
* 4.4:
  Fix PHP 8.1 null values
  [Console] Fix PHP 8.1 null error for preg_match flag
  Fix: Article
  Definition::removeMethodCall should remove all matching calls
  mark the LazyIterator class as internal
  fix extracting mixed type-hinted property types
  keep valid submitted choices when additional choices are submitted
2021-02-15 19:55:04 +01:00
Robin Chalas
70783821db minor #40201 [Workflow] Re-add InvalidTokenConfigurationException for BC (chalasr)
This PR was merged into the 5.2 branch.

Discussion
----------

[Workflow] Re-add InvalidTokenConfigurationException for BC

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

Reverts the BC breaking part of #39671

Commits
-------

b596568db9 [Workflow] Re-add InvalidTokenConfigurationException for BC
2021-02-15 19:16:51 +01:00
Fabien Potencier
1b94d88a28 feature #40202 [Workflow] Deprecate InvalidTokenConfigurationException (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Workflow] Deprecate InvalidTokenConfigurationException

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

Commits
-------

6ed759189d [Workflow] Deprecate InvalidTokenConfigurationException
2021-02-15 18:16:52 +01:00
Robin Chalas
6ed759189d [Workflow] Deprecate InvalidTokenConfigurationException 2021-02-15 15:47:12 +01:00
Robin Chalas
b596568db9 [Workflow] Re-add InvalidTokenConfigurationException for BC 2021-02-15 15:36:09 +01:00
Grégoire Pineau
b15bfc45d6 bug #39671 [Worflow] Fixed GuardListener when using the new Security system (lyrixx)
This PR was merged into the 5.2 branch.

Discussion
----------

[Worflow] Fixed GuardListener when using the new Security system

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

Commits
-------

bd26a79461 [Worflow] Fixed GuardListener when using the new Security system
2021-02-15 15:23:01 +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
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
Fabien Potencier
35a155863c bug #40186 Fix package name (fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Fix package name

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| 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        | 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 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

Fix Package name as the Bridge is named `SpotHit` and not `Spothit`.

Commits
-------

5f8c736303 Fix package name
2021-02-14 18:36:15 +01:00
Fabien Potencier
5f8c736303 Fix package name 2021-02-14 18:34:21 +01:00
Robin Chalas
a8850a4813 minor #40183 [PasswordHasher] Fix: Use algorithm instead of algo (localheinz)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PasswordHasher] Fix: Use algorithm instead of algo

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

This pull request

* [x] renames fields, variables, and parameters using `algos` or `algo` (which appear to be entirely made-up words) to `algorithms` and `algorithm` respectively

Commits
-------

a4dd14b478 Fix: Use algorithm instead of algo
2021-02-14 15:41:30 +01:00
Robin Chalas
2132a83e5c minor #40182 [PasswordHasher] Fix: Run 'php-cs-fixer fix' (localheinz)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PasswordHasher] Fix: Run 'php-cs-fixer fix'

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

This pull request

* [x] runs `php-cs-fixer fix` in `src/Symfony/Component/PasswordHasher`

💁‍♂️ I do not know who or what enforces coding standard issues in this repository, but after opening a few pull requests in this repository, I noticed that `fabbot.io` repeatedly reports coding standard violations that are unrelated to the proposed changes. As an experiment I ran

```
$ php-cs-fixer fix
```

on the entire repository and found a lot of issues. Not sure, would you not prefer to have these fixed?

Since the `PasswordHasher` component was only recently extracted, I assume it is safe to propose to run `php-cs-fixer fix` at least on this newly introduced component.

Commits
-------

2102170e43 Fix: Run 'php-cs-fixer fix'
2021-02-14 15:25:17 +01:00
Andreas Möller
a4dd14b478
Fix: Use algorithm instead of algo 2021-02-14 15:20:17 +01:00
Andreas Möller
2102170e43
Fix: Run 'php-cs-fixer fix' 2021-02-14 15:12:38 +01:00
Robin Chalas
702a3ee82f feature #40176 [PasswordHasher] Use bcrypt as default hash algorithm for "native" and "auto" (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PasswordHasher] Use bcrypt as default hash algorithm for "native" and "auto"

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

As suggested in https://github.com/symfony/symfony/pull/39802#issuecomment-776790017,  based on https://twitter.com/TerahashCorp/status/1155129705034653698

Commits
-------

332817ac29 Use bcrypt as default password hash algorithm for "native" and "auto"
2021-02-14 15:05:49 +01:00
Robin Chalas
d1fbf750bf minor #40181 [PasswordHasher] Fix: Typo (localheinz)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PasswordHasher] Fix: Typo

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

This pull request

* [x] fixes a typo

Commits
-------

3fbf7e963d Fix: Typo
2021-02-14 14:42:31 +01:00
Andreas Möller
3fbf7e963d
Fix: Typo 2021-02-14 14:37:28 +01:00
Robin Chalas
332817ac29 Use bcrypt as default password hash algorithm for "native" and "auto" 2021-02-14 14:22:26 +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
163df1e673 feature #40048 [FrameworkBundle] Deprecate session.storage service (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate session.storage service

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | TODO

Following the deprecation of `session` service, this PR deprecate other services that contains state: `session.storage`
- `session.storage`
- `session.storage.native`, `session.storage.php_bridge` and `session.storage.mock_file`
- `session.storage.metadata_bag`

Because people can inject / decorate override all these services, providing a migration path like I did with `session` would have been very hard. That's why, I added a new `opt-in` flag:

When people use `framework.session: true` or `framework.session.storage_id` the previous behavior is kept and deprecation are triggered when accessing the services.
But when people use the new `framework.session.storage_factory_id` configuration, the previous services (`session.storage.*`) are deleted (in case people would try to inject the legacy `session.storage*` services and would have expect to manipulate the same objects as the object injected in the session)

Commits
-------

37c591516a Deprecate session.storage
2021-02-14 11:40:26 +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
2f0bc30e38 Fix CS 2021-02-14 11:23:24 +01:00
Fabien Potencier
7ed72177d0 feature #40169 [DependencyInjection] Negated (not:) env var processor (bpolaszek)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Negated (not:) env var processor

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      |no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#14976

This little PR suggests a `not:` env var processor (in a perfect world, I would name it `!:` but only words are accepted as prefixes 🙃)
Goal is to _negate_ a boolean env variable.

Example usage:

```bash
FOO=yes
BAR=off
```

```yaml
# config/services.yaml
parameters:
    not_foo: '%env(not:FOO)%' # false
    not_bar: '%env(not:BAR)%' # true
```

I'm thinking of this for this kind of usages:
- `some_prod_related_stuff: '%env(not:APP_DEBUG)%'`
- `enabled: '%env(not:bool:key:disabled:query_string:SOME_DSN)%'`

~~Processor raises an exception when preceding resolved value is not a boolean.~~
This processor allows any truthy/falsy values, like `bool:`.

Thank you,
Ben

Commits
-------

56545fd270 [DependencyInjection] Negated (not:) env var processor
2021-02-14 11:22:20 +01:00
Beno!t POLASZEK
56545fd270 [DependencyInjection] Negated (not:) env var processor 2021-02-14 11:22:13 +01:00
Jérémy Derussé
37c591516a
Deprecate session.storage 2021-02-13 15:58:50 +01:00
Wouter de Jong
c757845643 feature #39802 [Security] Extract password hashing from security-core - with proper wording (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Extract password hashing from security-core - with proper wording

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fixes #39698
| License       | MIT
| Doc PR        | todo

This PR renames password "encoders" to password _hashers_ (naming widely used, see e.g. django or laravel).
This also takes the opportunity to extract the logic related to password hashing from security-core, moving it to a new password-hasher component.
Nowadays, many modern web apps and APIs don't deal with passwords at all, that's why splitting makes sense as a step towards making security-core not tied to the password concept.

For upgrading, applications will have to use `passwords_hashers` instead of `encoders` in their security configuration,  and type-hint against `PasswordHasherInterface` (and related) instead of `PasswordEncoderInterface`.

The proposed API is not much different from the encoder one regarding behavior and signatures, and it is slightly more close to the PHP built-in password hashing API:

```php
namespace Symfony\Component\PasswordHasher;

interface PasswordHasherInterface
{
    public function hash(string $plainPassword): string;

    public function verify(string $hashedPassword, string $plainPassword): bool;

    public function needsRehash(string $hashedPassword): bool;
}
```

Commits
-------

c5c981c559 [Security] Extract password hashing from security-core - using the right naming
2021-02-12 16:53:00 +01:00
Robin Chalas
c5c981c559 [Security] Extract password hashing from security-core - using the right naming 2021-02-12 16:42: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
Fabien Potencier
15e2067d50 minor #40166 [HttpFoundation] Fix typo in exception message (carlos-ea)
This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[HttpFoundation] Fix typo in exception message

| Q             | A
| ------------- | ---
| Branch?       | 5.2 for bug fixes
| Bug fix?      | yes
| 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 -->
<!--
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 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

Commits
-------

2248af5857 [HttpFoundation] Fix typo in exception message
2021-02-12 16:32:43 +01:00
carlos-ea
2248af5857 [HttpFoundation] Fix typo in exception message 2021-02-12 16:32:37 +01:00
Christian Flothmann
4a2c996b95 mark the LazyIterator class as internal 2021-02-12 11:48:09 +01:00
Christian Flothmann
fe4e2956e3 Merge branch '5.2' into 5.x
* 5.2:
  add missing return type declaration
  Modernize func_get_args() calls to variadic parameters
  Use a lazyintertor to close files descriptors when no longer used
2021-02-12 11:47:00 +01:00
Christian Flothmann
6dce3227db Merge branch '4.4' into 5.2
* 4.4:
  add missing return type declaration
  Modernize func_get_args() calls to variadic parameters
  Use a lazyintertor to close files descriptors when no longer used
2021-02-12 11:38:38 +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
Alexander M. Turek
9323f413cb Merge branch '5.2' into 5.x
* 5.2:
  [Contracts] fix branch-aliases
  Fix transient test
2021-02-12 01:05:48 +01:00
Alexander M. Turek
f2f880ac2c feature #40143 [Filesystem] improve messages on failure (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Filesystem] improve messages on failure

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

Commits
-------

f5ddfadcb2 [Filesystem] improve messages on failure
2021-02-11 20:49:37 +01:00
Alexander M. Turek
1f067bc4f7 bug #40114 [HttpFoundation] Fix consistency in sessions not found exceptions (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[HttpFoundation] Fix consistency in sessions not found exceptions

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40112
| License       | MIT
| Doc PR        | -

Make `Request::getSession` thrown a `SessionNotFoundException` and make `SessionNotFoundException` extends `\BadMethodCallException` for backward compatibility and

Commits
-------

7fcb76d367 Fix consistency in sessions not found exceptions
2021-02-11 20:46:04 +01:00