Commit Graph

53599 Commits

Author SHA1 Message Date
Fabien Potencier
c54bfb779c feature #40174 [Mailer] AWS SES transport Source ARN header support (chekalsky)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Mailer] AWS SES transport Source ARN header support

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | need help (this part was never mentioned in docs)

AWS SES API has [FromEmailAddressIdentityArn](https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html#SES-SendEmail-request-FromEmailAddressIdentityArn) field which is necessary for using identities verified by different AWS account.

With this PR I am adding ability to set this field via setting `X-SES-SOURCE-ARN` header.

I've added support for this API field in the same way as it was done before for `X-SES-CONFIGURATION-SET`. It was never documented, but you can use header `X-SES-CONFIGURATION-SET` to set `ConfigurationSetName` API param.

Commits
-------

d7225db7d5 [Mailer] AWS SES transport Source ARN header support
2021-02-16 08:13:33 +01:00
Ilya Chekalsky
d7225db7d5 [Mailer] AWS SES transport Source ARN header support 2021-02-16 08:13:27 +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
1262b060e7 feature #38473 [Framework] Add tag assets.package to register asset packages (GromNaN)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Framework] Add tag assets.package to register asset packages

Replaces #38366

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

To configure asset packages in an application, we have to declare it in the `framework` configuration ([doc for assets config](https://symfony.com/doc/current/reference/configuration/framework.html#assets)). In some case we cannot use this configuration:
- To use a custom class as package
- To register an asset package in a shared bundle (my use-case).

This PR adds the `assets.package` tag. This tag is use to collect and inject package services into the `assets.packages` service, that is the registry for all packages. Since every package needs a name, the `package` attribute of the tag is used (same naming convention that the `console.command` tag).

Main changes:
- the packages defined in the `framework.assets` configuration are injected into the `assets.packages` using the tag instead of being directly injected in service declaration.
- changed signature of `Symfony\Components\Assets\Packages` constructor to accept an iterator (backward compatible).
- a new alias `assets._default_package` is defined even if assets are not configured.

### Example in `symfony/demo` ([commit](e5e5a8fff0...GromNaN:assets-package-tag)):

In `config/services.yaml`:
```yaml
    avatar.strategy:
        class: Symfony\Component\Asset\VersionStrategy\JsonManifestVersionStrategy
        arguments:
            - '%kernel.project_dir%/public/build/manifest.json'

    avatar.package:
        class:  Symfony\Component\Asset\Package
        arguments:
            - '@avatar.strategy'
            - '@assets.context'
        tags:
            - { name: assets.package, package: avatars }
```

Then we can use the package anywhere
```twig
<img src="{{ asset('anna.jpg', 'avatars') }}">
```

### Alternative using autoconfiguration with a custom class:

With a custom class implementing the `PackageInterface`, the package name can be provided by a the static method `getDefaultPackageName`. Autowiring and autoconfiguration will import the package.

```php
namespace App\Asset;

use Symfony\Component\Asset\PackageInterface;

class AvatarPackage implements PackageInterface
{
    public static function getDefaultPackageName(): string
    {
        return 'avatars';
    }

    // ... Implements the interface
}
```

Commits
-------

6217ff7b6f [Asset] Add tag assets.package to register asset packages
2021-02-16 08:00:54 +01:00
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
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
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
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
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