Commit Graph

43030 Commits

Author SHA1 Message Date
Amrouche Hamza
91fcbea977 [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability 2019-07-08 15:37:49 +02:00
Maxime Steinhausser
d2430584cd [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit 2019-07-08 15:18:18 +02:00
Fabien Potencier
350ec6cc7e minor #32428 [Stopwatch] Fix missing deprecations (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[Stopwatch] Fix missing deprecations

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | no needed

Fix https://github.com/symfony/symfony/pull/32408

Commits
-------

527bf89a27 Fix missing deprecations
2019-07-08 15:06:45 +02:00
Fabien Potencier
e1cea970c0 feature #31511 [Validator] Allow to use property paths to get limits in range constraint (Lctrs)
This PR was squashed before being merged into the 4.4 branch (closes #31511).

Discussion
----------

[Validator] Allow to use property paths to get limits in range constraint

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Part of #31503
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11793

Similar as #22576, but for the `Range` constraint.

Commits
-------

2b509904c8 [Validator] Allow to use property paths to get limits in range constraint
2019-07-08 15:05:23 +02:00
Lctrs
2b509904c8 [Validator] Allow to use property paths to get limits in range constraint 2019-07-08 15:04:44 +02:00
Yonel Ceruto
527bf89a27 Fix missing deprecations 2019-07-08 08:57:32 -04:00
Fabien Potencier
5328c4b552 fixed tests on old PHP versions 2019-07-08 14:55:32 +02:00
Fabien Potencier
fea98a8473 bug #31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)
This PR was squashed before being merged into the 3.4 branch (closes #31620).

Discussion
----------

[FrameworkBundle] Inform the user when save_path will be ignored

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no  / maybe??
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31611
| License       | MIT

When a project is created, framework.yaml or config.yml has handler_id set to ~. This uses the native php SessionHandler object which is instantiated with the save_path setting from php.ini or php-fpm.d/www.conf. If you set a save_path, it is silently ignored. When using mod_php for apache or php-fpm running as apache/nginx this is typically not a big deal (except your session files are stored someplace other than you actually wanted). However if using php-fpm and running as a non-standard user for the distro, it will fail silently. Sessions won't be saved because the setting has no effect. This throws a warning in those cases to inform the user.

_It could be a BC because it changes the default configuration however fixes a 'long standing bug' if you will. Not sure what you want to do about that part._

Commits
-------

a0901294d4 [FrameworkBundle] Inform the user when save_path will be ignored
2019-07-08 14:54:13 +02:00
Nathanael d. Noblet
a0901294d4 [FrameworkBundle] Inform the user when save_path will be ignored 2019-07-08 14:54:05 +02:00
Fabien Potencier
2d04e20e7e bug #32056 [DI] deprecate booting the kernel twices (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] deprecate booting the kernel twices

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31233   <!-- #-prefixed issue number(s), if any -->
| 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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

This adds a check to see if the kernel has been booted twices in a single test, and throw a deprecation

Commits
-------

905bec4577 [DI] throw an exception when the kernel has been booted twices
2019-07-08 14:22:23 +02:00
Fabien Potencier
bd498f2503 fixed CS 2019-07-08 13:57:06 +02:00
Fabien Potencier
931965a448 bug #32096 Don't assume port 0 for X-Forwarded-Port (alexbowers, xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

Don't assume port 0 for X-Forwarded-Port

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | none added
| Fixed tickets |
| License       | MIT
| Doc PR        | -

If you use X-Forwarded-Host but don't provide X-Forwarded-Port, it will default to `0.0.0.0:` which then assumes port `0` instead of following its default assumption based on the scheme.

Commits
-------

adcdd938a4 PHP 5 compat
6c49a0c758 Add test case
c266d6c737 Update Request.php
23db9be884 Don't assume port 0 for X-Forwarded-Port
2019-07-08 13:55:51 +02:00
Fabien Potencier
98bbc57e95 bug #31820 [SecurityBundle] Fix profiler dump for non-invokable security listeners (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix profiler dump for non-invokable security listeners

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Listeners can be any callable since 4.3.

Commits
-------

f7738d934b [SecurityBundle] Fix profiler dump for non-invokable security listeners
2019-07-08 13:31:38 +02:00
Robin Chalas
f7738d934b [SecurityBundle] Fix profiler dump for non-invokable security listeners 2019-07-08 12:43:35 +02:00
Fabien Potencier
ea0da05cd6 feature #32424 [Console] don't redraw progress bar more than every 100ms by default (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] don't redraw progress bar more than every 100ms by default

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no (behavior change)
| BC breaks?    | no (behavior change)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Follow up of https://github.com/symfony/symfony/pull/26339
Looks like something we can and should do on 4.4 to me.

Commits
-------

df551e945c [Console] don't redraw progress bar more than every 100ms by default
2019-07-08 12:34:39 +02:00
Nicolas Grekas
df551e945c [Console] don't redraw progress bar more than every 100ms by default 2019-07-08 12:29:08 +02:00
Fabien Potencier
7647209b9a feature #32418 [Console] Added Application::reset() (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Added Application::reset()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Symfony leaks a lot in CLI when using the EventDispatcher. I'm working on it.

But instead of fixing the root cause, it can be legit to go quick and to reset all services.
So IMHO, this services should be exposed, and always available

Commits
-------

15ba5791cd [Console] Added Application::reset()
2019-07-08 12:10:30 +02:00
Fabien Potencier
400eaa676a feature #31217 [WebserverBundle] Deprecate the bundle in favor of symfony local server (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebserverBundle] Deprecate the bundle in favor of symfony local server

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | to do <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Since most of the feature added to the symfony local server (using php-fpm) will be handy for all developers and as said in https://github.com/symfony/symfony/issues/25748#issuecomment-485740082, I agree that we should deprecate the WebserverBundle in favor of the [Symfony Local Server](https://symfony.com/doc/current/setup/symfony_server.html) cc @stof @fabpot

Commits
-------

7307907585 [WebserverBundle] Deprecate the bundle in favor of symfony local server
2019-07-08 11:58:44 +02:00
Grégoire Pineau
15ba5791cd [Console] Added Application::reset() 2019-07-08 11:58:42 +02:00
Fabien Potencier
87a6f04409 feature #31554 [SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462 (berezuev)
This PR was merged into the 4.4 branch.

Discussion
----------

[SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462

| Q             | A
| ------------- | ---
| Branch? | 4.4
| -- | --
| Bug fix? | yes
| New feature? | no
| BC breaks? | no I think
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ...
| License | MIT

Rebase of #28462. Origin description:
> ```
> [2018-09-13 20:43:38] security.INFO: Authentication request failed. {"exception":"[object] (Symfony\\Component\\Security\\Core\\Exception\\AuthenticationServiceException(code: 0): An exception occurred while executing
>  ...
>  Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.phone' in 'field list' at
> ```
>
> Definitely I think this is NOT info, but error.
> And since it's info, it's not logged in production because of `fingers_crossed` with `action_level: error` - so to actually see the real error behind `Authentication request could not be processed due to a system problem.` I had to debug on production. Very bad practice IMHO.

Commits
-------

867eb78cfe [SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462
2019-07-08 11:56:07 +02:00
Fabien Potencier
14614bd895 feature #32284 [Cache] Add argument $prefix to AdapterInterface::clear() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Add argument $prefix to AdapterInterface::clear()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR allows clearing `AdapterInterface` implementations by prefix of keys. The goal is to fix an edge case situation in `ProxyAdapter`: right now, when one calls `->clear()` on a proxy adapter that is configured to add a prefix to all the keys passed to the decorated pool, we clear it all; while only the subset that starts with the prefix should be.

Since `AdapterInterface` is an "internal" interface (ie its purpose is to create compatible implementations - *NOT* to be type-hinted for), this is not really a user-facing change.

/cc @Nyholm, this came out after we talked about proxified chain pools

Commits
-------

ad6f6cf900 [Cache] Add argument $prefix to AdapterInterface::clear()
2019-07-08 11:50:54 +02:00
Fabien Potencier
3e2ee71bcb feature #32423 [ServerBundle] Display all logs by default (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[ServerBundle] Display all logs by default

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32111
| License       | MIT
| Doc PR        |

Instead of relying on `-vvv` behavior, we display all logs.
End user has two ways of filtering now:

* with the `--filter` options
* by configuring the handler in `config/dev/monolog.yaml`

Commits
-------

54b0809d2c [ServerBundle] Display all logs by default
2019-07-08 11:44:22 +02:00
Amrouche Hamza
7307907585
[WebserverBundle] Deprecate the bundle in favor of symfony local server 2019-07-08 11:40:47 +02:00
Fabien Potencier
c202e96cd6 feature #26339 [Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | TBA

The way ProgressBar redraw frequency works currently requires to know speed of progress beforehand, which is impossible to know in some situations, e.g. when showing progress of download, or I/O speed. Setting frequency too low relative to progress speed throttles I/O speed and makes progress bar flicker too much, setting it too high makes progress bar unresponsive. Current behaviour IMHO undermines usefulness of ProgressBar.

This is an attempt to replace this with more consistent experience, not requiring to know speed of progress.)

Commits
-------

83edac321e [Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods
2019-07-08 11:29:00 +02:00
Fabien Potencier
853e032c19 fixed CS 2019-07-08 11:24:04 +02:00
Fabien Potencier
94db7d4c3f bug #32392 [Messenger] Doctrine Transport: Support setting auto_setup from DSN (bendavies)
This PR was squashed before being merged into the 4.3 branch (closes #32392).

Discussion
----------

[Messenger] Doctrine Transport: Support setting auto_setup from DSN

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |  <!-- required for new features -->

It was not possible to set `auto_setup` via the dsn, as the result would always be a string, resulting in setup always being performed because a bool is required.
The same was true if `auto_setup` was provided in `options` as a string.

I've fixed ensuring that the final configuration contains a bool for `auto_setup`.

Additionally, constructing the `configuration` was overly complex and hard to grok, so I've hopefully simplified it as part of this PR.

As an aside the three transports all do configuration construction in different ways with varying styles. It would be nice to neaten them up.

Commits
-------

213dfd1492 [Messenger] Doctrine Transport: Support setting auto_setup from DSN
2019-07-08 11:23:24 +02:00
Ben Davies
213dfd1492 [Messenger] Doctrine Transport: Support setting auto_setup from DSN 2019-07-08 11:23:12 +02:00
Alexey Berezuev
867eb78cfe [SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462 2019-07-08 12:18:00 +03:00
Grégoire Pineau
54b0809d2c [ServerBundle] Display all logs by default
Instead of relying on `-vvv` behavior, we display all logs.
End user has two ways of filtering now (instead of 3 previously):

* with the `--filter` options
* by configuring the handler in `config/dev/monolog.yaml`
2019-07-08 11:06:24 +02:00
Fabien Potencier
e6318068fa feature #31269 [Translator] Dump native plural formats to po files (Stadly)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead (closes #31269).

Discussion
----------

[Translator] Dump native plural formats to po files

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29963, #10152
| License       | MIT
| Doc PR        |

Implementing support for dumping to the native po plural format.

```
'foo|foos' => 'bar|bars'
```

Before, the entry above was dumped directly:
```
msgid "foo|foos"
msgstr "bar|bars"
```

With this PR, it is dumped using the native po plural format:
```
msgid "foo"
msgid_plural "foos"
msgstr[0] "bar"
msgstr[1] "bars"
```

Strings using explicit rules or contain more than 2 pluralization forms are still dumped directly, as the po format does not support such cases:

```
'{0} no foos|one foo|%count% foos' => '{0} no bars|one bar|%count% bars'
```

```
msgid "{0} no foos|one foo|%count% foos"
msgstr "{0} no bars|one bar|%count% bars"
```

This PR complements #31266, fixing loading of native po plural formats.

Commits
-------

dc31739288 [Translator] Dump native plural formats to po files
2019-07-08 10:26:27 +02:00
Stadly
dc31739288 [Translator] Dump native plural formats to po files 2019-07-08 10:26:08 +02:00
Fabien Potencier
feab919c86 bug #31267 [Translator] Load plurals from mo files properly (Stadly)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translator] Load plurals from mo files properly

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/10152#issuecomment-55522675
| License       | MIT
| Doc PR        |

Plurals were not handled correctly when loading mo files.
```
msgid "foo"
msgid_plural "foos"
msgstr[0] "bar"
msgstr[1] "bars"
```

Before, the mo entry above was treated as two entries, which doesn't make sense:
```
'foo' => 'bar'
'foos' => '{0} bar|{1} bars'
```

With this PR, it is treated as one entry:
```
'foo|foos' => 'bar|bars'
```

This PR does the same as #31266, just for mo files instead of po files. Note, however, that the old behavior differed between po and mo files: `'foos' => 'bar|bars'` for po files and `'foos' => '{0} bar|{1} bars'` for mo files.

Commits
-------

97d28b5e4e Load plurals from mo files properly
2019-07-08 10:22:53 +02:00
Fabien Potencier
9fc8d2ec63 bug #31266 [Translator] Load plurals from po files properly (Stadly)
This PR was squashed before being merged into the 3.4 branch (closes #31266).

Discussion
----------

[Translator] Load plurals from po files properly

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/10152#issuecomment-55522675
| License       | MIT
| Doc PR        |

Plurals were not handled correctly when loading po files.
```
msgid "foo"
msgid_plural "foos"
msgstr[0] "bar"
msgstr[1] "bars"
```

Before, the po entry above was treated as two entries, which doesn't make sense:
```
'foo' => 'bar'
'foos' => 'bar|bars'
```

With this PR, it is treated as one entry:
```
'foo|foos' => 'bar|bars'
```

Commits
-------

6b69a99230 [Translator] Load plurals from po files properly
2019-07-08 10:21:27 +02:00
Stadly
6b69a99230 [Translator] Load plurals from po files properly 2019-07-08 10:21:19 +02:00
Fabien Potencier
3c9ff1f8ac feature #31560 [Ldap][Security] LdapBindAuthenticationProvider does not bind before search query (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Ldap][Security] LdapBindAuthenticationProvider does not bind before search query

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yesish
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #24210   <!-- #-prefixed issue number(s), 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/roadmap):
 - 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 the master branch.
-->

This is tagged as a bug but since we need to add new params to the differents login providers and a deprecation I think we need to consider it as a new feature, maybe this could go in 3.4 too but without the deprecation.

This allow using a searchDn and a sarchPassword when passing a queryString in order to do the query authenticated.

Commits
-------

cb2d97f92b [Ldap][Security] LdapBindAuthenticationProvider does not bind before search query
2019-07-08 10:00:04 +02:00
Amrouche Hamza
cb2d97f92b [Ldap][Security] LdapBindAuthenticationProvider does not bind before search query 2019-07-08 10:00:03 +02:00
Fabien Potencier
950db8e85b fixed CS 2019-07-08 09:52:12 +02:00
Fabien Potencier
088270ebbd feature #31626 [Console] allow answer to be trimmed by adding a flag (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] allow answer to be trimmed by adding a flag

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11603 <!-- 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/roadmap):
 - 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 the master branch.
-->

According to https://github.com/symfony/symfony/issues/23210#issuecomment-495998087 we add a new flag in the `Question` class to be able to not trim the answer.

Commits
-------

8f182d811e [Console] allow answer to be trimmed by adding a flag
2019-07-08 09:51:32 +02:00
Fabien Potencier
6b8d4aa57e bug #32383 [Serializer] AbstractObjectNormalizer ignores the property types of discriminated classes (sandergo90)
This PR was merged into the 4.2 branch.

Discussion
----------

[Serializer] AbstractObjectNormalizer ignores the property types of discriminated classes

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27607
| License       | MIT
| Doc PR        |

As discusses in ticket #27607, when using a discriminator map and the symfony serializer, things go wrong when having two classes in the discriminator map having the same property name. When the function ```validateAndDenormalize``` is called, the function ```getTypes``` would be called with the wrong class name.

If you take a look at the ```getTypes``` function below, I'm not even sure if we still need the part of the discriminator at this place because we already passed the class name of the discriminated class.

```
    /**
     * @return Type[]|null
     */
    private function getTypes(string $currentClass, string $attribute)
    {
        if (null === $this->propertyTypeExtractor) {
            return null;
        }

        if (null !== $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) {
            return $types;
        }

        if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForClass($currentClass)) {
            if ($discriminatorMapping->getTypeProperty() === $attribute) {
                return [
                    new Type(Type::BUILTIN_TYPE_STRING),
                ];
            }

            foreach ($discriminatorMapping->getTypesMapping() as $mappedClass) {
                if (null !== $types = $this->propertyTypeExtractor->getTypes($mappedClass, $attribute)) {
                    return $types;
                }
            }
        }

        return null;
    }
```

Commits
-------

9fc56c7e28 [Serializer]: AbstractObjectNormalizer ignores the property types of discriminated classes
2019-07-08 09:44:03 +02:00
Fabien Potencier
8b439ee031 fixed CS 2019-07-08 09:43:01 +02:00
Fabien Potencier
dc56389b03 feature #31876 [WebProfilerBundle] Add clear button to ajax tab (Matts)
This PR was squashed before being merged into the 4.4 branch (closes #31876).

Discussion
----------

[WebProfilerBundle] Add clear button to ajax tab

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31839
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

For pages that have been open for a long time, the profiler ajax tab can start filling up fast. In #31839 the request to allow the history to be cleared with one click.

The reason why I did not align the button to the right, is because after looking at the other tabs. None of them had items that were aligned to the right. Moved the addEventListener above the ajax tab logic to keep the code consistent.

Ps. Please be nice, this is my first contribution 🍰

<!--
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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

6bff4db6d3 [WebProfilerBundle] Add clear button to ajax tab
2019-07-08 09:42:34 +02:00
Matthew Smeets
6bff4db6d3 [WebProfilerBundle] Add clear button to ajax tab 2019-07-08 09:42:23 +02:00
Sander
9fc56c7e28 [Serializer]: AbstractObjectNormalizer ignores the property types of discriminated classes
Add tests

Remove test group

Allow null

Add quux null attribute

Add quux value to serialize test
2019-07-08 09:31:20 +02:00
Fabien Potencier
a22eeb3fff fixed deprecation message 2019-07-08 09:23:44 +02:00
Fabien Potencier
499ad6df0d minor #32408 [Stopwatch] Deprecate passing null in Section::get() method. (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[Stopwatch] Deprecate passing null in Section::get() method.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32179<!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This PR is related to https://github.com/symfony/symfony/pull/32242

Commits
-------

ea4817677b [Stopwatch] Deprecate passing null in Section::get() method.
2019-07-08 09:21:34 +02:00
Fabien Potencier
a640c30df2 feature #32415 [Translation] deprecate passing a null locale (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] deprecate passing a null locale

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- 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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

According to the discussion in https://github.com/symfony/symfony/pull/32386#discussion_r300590343 it seems that allowing null here was not the right thing to do, so we are deprecating this behaviour.

Commits
-------

088615ddaf [Translation] deprecate passing a null locale
2019-07-08 08:50:08 +02:00
Amrouche Hamza
088615ddaf
[Translation] deprecate passing a null locale 2019-07-08 08:40:36 +02:00
Fabien Potencier
166502c714 minor #32417 [Intl] Remove --dev from intl compile autoloader (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Remove --dev from intl compile autoloader

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Remove implicit composer default (`jakzal/php-intl` uses latest composer during compile)

Commits
-------

8ffc61692d [Intl] Remove --dev from intl compile autoloader
2019-07-08 08:36:40 +02:00
Fabien Potencier
51cf65e4ba feature #32290 [HttpClient] Add $response->toStream() to cast responses to regular PHP streams (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Add $response->toStream() to cast responses to regular PHP streams

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR adds `$response->toStream()` to cast responses to regular PHP streams, and uses the method in `Psr18Client` and `HttplugClient`.

This means `Psr18Client` and `HttplugClient` will now be lazy past response headers. I'm not sure any other PSR-18 implementation has this behavior. :)

This also adds `StreamWrapper::createResource()` to turn any `ResponseInterface` implementation into a PHP stream.

/cc @Nyholm FYI since we discussed about this recently.

Commits
-------

a59e0af24a [HttpClient] Add $response->toStream() to cast responses to regular PHP streams
2019-07-08 08:35:40 +02:00
Fabien Potencier
4ef1f2fa8d minor #32385 Fix CS regarding nullable arguments (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix CS regarding nullable arguments

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Let's keep our CS consistent.

Commits
-------

ec5d7346b3 Fix CS regarding nullable arguments
2019-07-08 08:24:29 +02:00