Commit Graph

44175 Commits

Author SHA1 Message Date
Thomas Calvet
3e2aada2d8 [Form][PropertyPathMapper] Avoid extra call to get config 2019-08-22 09:15:31 +02:00
Nicolas Grekas
21b87024f0 Use PHP 7.4 on deps=low 2019-08-22 08:53:14 +02:00
Tobias Schultze
5ffec16396 [HttpKernel] remove unused fixtures
those are remnants of bundle inheritance that has been removed in sf 4
2019-08-21 20:13:34 +02:00
Nicolas Grekas
153e081119 ws fix 2019-08-21 17:53:07 +02:00
Nicolas Grekas
f2e2df6a0c feature #33152 Mark all dispatched event classes as final (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

Mark all dispatched event classes as final

| 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? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

I think we should mark all our Event classes as final. There is no point in people extending them as the libraries that use the event, will only dispatch this event. So extending events in user-land achieves nothing as the subclasses won't be dispatched.
I'm not talking about the base events that are meant to be extended like KernelEvent, but the leaf events like ExceptionEvent, ResponseEvent etc.
Then we can also make them real final in 5.0 as the events are value objects that should not be mocked.

Commits
-------

4bb38eec89 Mark all dispatched event classes as final
2019-08-21 17:50:31 +02:00
Nicolas Grekas
2fff132cbb typo 2019-08-21 17:39:13 +02:00
Nicolas Grekas
55cd8d6f3e minor #33279 Add return types to tests and final|internal|private methods (nicolas-grekas, derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Add return types to tests and final|internal|private methods

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

#33266 made me spot an issue with my logic to add return types with help from `DebugClassLoader`.
Here is a completing PR, with the logic expanded to test classes.

I need help to fix tests, /cc @derrabus :)

Commits
-------

c39fd9c973 Fixed tests on the Security and Form components
fc186bb78f Add return types to tests and final|internal|private methods
2019-08-21 17:22:48 +02:00
Tobias Schultze
4bb38eec89 Mark all dispatched event classes as final 2019-08-21 17:17:54 +02:00
Alexander M. Turek
c39fd9c973 Fixed tests on the Security and Form components 2019-08-21 17:17:31 +02:00
Nicolas Grekas
fc186bb78f Add return types to tests and final|internal|private methods 2019-08-21 17:14:41 +02:00
Nicolas Grekas
8d8d3d4d40 minor #33280 fix deprecated call to setLocale with null (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

fix deprecated call to setLocale with null

| 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? | 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        |

Fix a potentially invalid call since #33272

Commits
-------

26f9afe8d1 fix deprecated call to setLocale with null
2019-08-21 17:06:06 +02:00
Nicolas Grekas
f499083f78 feature #33258 [HttpKernel] deprecate global dir to load resources from (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] deprecate global dir to load resources from

| 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 | #31915   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

Replaces #31958

Here two example deprecations by adding files in the deprecated locations:
```
Overwriting the resource "@AcmeBundle/Resources/config/routing.yaml" with "/vagrant/src/Resources/AcmeBundle/config/routing.yaml" is deprecated since Symfony 4.4 and will be removed in 5.0.
Loading the file "foobar.yaml" from the global resource directory "/vagrant/src" is deprecated since Symfony 4.4 and will be removed in 5.0.
```

Commits
-------

aa82566f76 [HttpKernel] deprecate global dir to load resources from
2019-08-21 17:04:54 +02:00
Nicolas Grekas
2984ab7e4e Merge branch '4.3' into 4.4
* 4.3:
  Do not extend the new SF 4.3 ControllerEvent so we can make it final
  Backported return type violation bugfixes.
  [FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther
2019-08-21 17:03:51 +02:00
Nicolas Grekas
dd153d8dce bug #33282 [HttpKernel] Do not extend the new SF 4.3 ControllerEvent so we can make it final (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpKernel] Do not extend the new SF 4.3 ControllerEvent so we can make it final

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | unlikely
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

See https://github.com/symfony/symfony/pull/33152#discussion_r313846346
Remember the ControllerEvent is new in SF 4.3 so we just go back to what it was before 4.3

Commits
-------

00140b6a7c Do not extend the new SF 4.3 ControllerEvent so we can make it final
2019-08-21 16:59:28 +02:00
Nicolas Grekas
72eaff8893 Merge branch '3.4' into 4.3
* 3.4:
  Backported return type violation bugfixes.
2019-08-21 16:58:38 +02:00
Nicolas Grekas
622ce1d0f4 minor #33281 Backported return type violation bugfixes (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Backported return type violation bugfixes

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

Fixed some doc blocks and broken return values discovered while working on #33279.

Commits
-------

8877a013d7 Backported return type violation bugfixes.
2019-08-21 16:56:53 +02:00
Fabien Potencier
46b944f9a7 bug #33278 [FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther (dunglas)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther

| 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 | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo (remove the line telling that these assertions aren't compatible with Panther)

Backport of essential fixes provided by https://github.com/symfony/symfony/pull/32207. It allows most assertions to work with Panther even when using Symfony 4.3.

Commits
-------

2316dc36fb [FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther
2019-08-21 16:44:34 +02:00
Tobias Schultze
00140b6a7c Do not extend the new SF 4.3 ControllerEvent so we can make it final 2019-08-21 16:40:57 +02:00
Alexander M. Turek
8877a013d7 Backported return type violation bugfixes. 2019-08-21 16:37:38 +02:00
Tobias Schultze
26f9afe8d1 fix deprecated call to setLocale with null 2019-08-21 15:33:13 +02:00
Kévin Dunglas
2316dc36fb
[FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther 2019-08-21 14:46:38 +02:00
Fabien Potencier
c9c3d667de bug #33273 Removed calls to Twig\Environment::loadTemplate() (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Removed calls to Twig\Environment::loadTemplate()

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

This PR prepares #33039. Twig 3 does not have the `loadTemplate()` anymore, so this PR replaces calls to that method.

Commits
-------

ea9e375b0b Removed calls to Twig\Environment::loadTemplate().
2019-08-21 13:50:41 +02:00
Alexander M. Turek
ea9e375b0b Removed calls to Twig\Environment::loadTemplate(). 2019-08-21 13:24:25 +02:00
Nicolas Grekas
9475b2e82d bug #33275 [Intl] make polyfill classes abstract, fix edge case (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] make polyfill classes abstract, fix edge case

| 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        | -

While working on return types, I keep stumbling on those classes that are `@internal`, but for which we must not add return types, because they're polyfills and are extended by stubs found in the `Resources` folder of the component.

Making the polyfills abstract fixes the linting issue.
This made me discover we have a glitch in the `getPattern()` implementation, that makes our version diverge from intl's. Fixed here too.

On 4.4 because let's not disrupt 3.4.

Commits
-------

c757b95aed [Intl] make polyfill classes abstract, fix edge case
2019-08-21 12:59:41 +02:00
Fabien Potencier
7046cac7f6 feature #33272 [Translation] deprecate support for null locales (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] deprecate support for null locales

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

Commits
-------

e6b6a9d33a deprecate support for null locales
2019-08-21 12:12:17 +02:00
Nicolas Grekas
c757b95aed [Intl] make polyfill classes abstract, fix edge case 2019-08-21 12:11:32 +02:00
Fabien Potencier
7aedfe7079 Merge branch '4.3' into 4.4
* 4.3:
  [Mime] Trim and remove line breaks from NamedAddress name arg
2019-08-21 10:50:18 +02:00
Fabien Potencier
58439e3166 bug #33216 [Mime] Trim and remove line breaks from NamedAddress name arg (maldoinc)
This PR was squashed before being merged into the 4.3 branch (closes #33216).

Discussion
----------

[Mime] Trim and remove line breaks from NamedAddress name arg

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | YES
| New feature?  | NO
| 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 | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This patch trims the name argument of named address in order to avoid some cases where the name is a non-empty input consisting of whitespace and line breaks which would lead to forming of addresses such as `" " <mail@example.org>` <sup>1</sup>

---

In a large Symfony codebase that deals with sending large volumes of email we encountered an issue after the Mailer was changed from PHPMailer to the Symfony Mailer component.

The issue: Some emails would not render correctly as either plaintext or html but instead the original email source with headers and quoted-printable content would render in clients such as MS Outlook 2003, later versions of Outlook and other clients do not seem affected.

After some investigation we found that the error came from a line that looked like this: `$message->addTo(new NamedAddress($contact->getEmailCanonical(), $contact->getFullName()))`.

The `getFullName` method simply concated the first/last name with a space in between. For contacts without either, this resulted in representation 1. This causes MS Outlook 2003 (potentially Outlook 2000 as well but this was not tested) to malfunction and completely fail to render the email.

This patch aims to fix the aforementioned issue.

Commits
-------

e491e3a594 [Mime] Trim and remove line breaks from NamedAddress name arg
2019-08-21 10:46:47 +02:00
Emirald Mateli
e491e3a594 [Mime] Trim and remove line breaks from NamedAddress name arg 2019-08-21 10:46:37 +02:00
Fabien Potencier
451daa0b06 feature #33269 [TwigBridge] Mark all classes extending twig as @final (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Mark all classes extending twig as @final

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes-ish
| 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 | refs #33039
| License       | MIT
| Doc PR        | n/a

Classes defining extensions/nodes/node visitors/token parsers should not be changed. They should be final.

That would also help with Twig 3.0 which introduces type hints (including return types).

Commits
-------

d657459a5f [TwigBridge] Mark all classes extending twig as @final
2019-08-21 10:34:41 +02:00
Fabien Potencier
b36961c36a feature #33270 [Mime] Remove NamedAddress (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Remove NamedAddress

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | yes     <!-- 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 | n/a
| License       | MIT
| Doc PR        | n/a

While working on #33091, we realize that having both `NamedAddress` and `Address` brings some unneeded complexity. Initially, I added both as some headers do not support `NamedAddress`es. But the code already does the right thing by "downgrading" them to `Address` instances. So, let's simplify our internal code and make life easier for our users too.

Commits
-------

eb7d74e6c5 [Mime] Remove NamedAddress
2019-08-21 10:32:13 +02:00
Christian Flothmann
e6b6a9d33a deprecate support for null locales 2019-08-21 10:16:47 +02:00
Fabien Potencier
d657459a5f [TwigBridge] Mark all classes extending twig as @final 2019-08-21 09:28:19 +02:00
Fabien Potencier
eb7d74e6c5 [Mime] Remove NamedAddress 2019-08-21 09:13:01 +02:00
Fabien Potencier
5a753b1428 minor #33245 [Messenger] remove patch release BC layer of durable and expiring delay (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] remove patch release BC layer of durable and expiring delay

| 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? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Removes the small BC layer of #33127 from 4.3 in 4.4

Commits
-------

d5aaf44529 [Messenger] remove patch release BC layer of durable and expiring delay
2019-08-21 07:11:00 +02:00
Tobias Schultze
aa82566f76 [HttpKernel] deprecate global dir to load resources from 2019-08-21 00:57:10 +02:00
Nicolas Grekas
22319a9935 minor #33264 [4.4] Add return types on internal|final|private methods (bis) (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] Add return types on internal|final|private methods (bis)

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

Found while working on #33259

`: self` is used for final methods only. I'd have preferred using `: object` but that's not possible on PHP 7.1

Commits
-------

23faee406f [4.4] Add return types on internal|final|private methods (bis)
2019-08-20 23:39:47 +02:00
Nicolas Grekas
23faee406f [4.4] Add return types on internal|final|private methods (bis) 2019-08-20 23:22:06 +02:00
Nicolas Grekas
7eb5feec51 minor #33261 Add types to routing and DI configuration traits. (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Add types to routing and DI configuration traits.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | I don't think so.
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179, #33228
| License       | MIT
| Doc PR        | N/A

This PR backports the type declarations added to the configurator traits of the Routing and DI components. These traits expose only final methods, so it should be pretty safe to add return types to them.

The only scenario I could make up where this change will break something is if a trait is used to override a method: https://3v4l.org/EAsk8 But I doubt that those traits are used that way.

On master, we've used the `object` return type for the fluent methods. That type is not available on 4.4 where we have to support php 7.1. I'm using `self` instead. Since the methods are final and thus cannot be overridden, I believe that we shouldn't run into covariance issues here, so `self` should be safe.

Commits
-------

1ca30c97e6 Add types to roting and DI configuration traits.
2019-08-20 23:07:54 +02:00
Nicolas Grekas
543e4013d0 bug #33263 [Ldap] Add missing LdapUser::setPassword() (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Ldap] Add missing LdapUser::setPassword()

| 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        | -

Required for password migrations.

Commits
-------

08dd4f3ae1 [Ldap] Add missing LdapUser::setPassword()
2019-08-20 23:06:27 +02:00
Nicolas Grekas
af6cf3140d Merge branch '4.3' into 4.4
* 4.3:
  More docblock fixes
  fix test
2019-08-20 23:03:47 +02:00
Nicolas Grekas
7a0787c8bd Merge branch '3.4' into 4.3
* 3.4:
  More docblock fixes
2019-08-20 23:02:25 +02:00
Nicolas Grekas
50a3d64729 minor #33262 More docblock fixes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

More docblock fixes

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

Found while working on #33259

Commits
-------

9b78d53d0d More docblock fixes
2019-08-20 23:00:23 +02:00
Robin Chalas
08dd4f3ae1 [Ldap] Add missing LdapUser::setPassword() 2019-08-20 22:58:33 +02:00
Nicolas Grekas
9b78d53d0d More docblock fixes 2019-08-20 22:53:36 +02:00
Alexander M. Turek
1ca30c97e6 Add types to roting and DI configuration traits. 2019-08-20 21:45:11 +02:00
Fabien Potencier
b7954640e3 bug #33260 [ErrorHandler] Registering basic exception handler to handle early failures (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Registering basic exception handler to handle early failures

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

This behavior was previously handled by the removed `ExceptionHandler` class in https://github.com/symfony/symfony/pull/32637.

As this method is mainly called during Kernel boot, where nothing is yet available, the Response content is always HTML. Otherwise, If all goes well on booting, this exception handler will be replaced in `DebugHandlersListener` class:
8073b8abfb/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php (L139)

where the advanced exception handler mechanism is activated.

Commits
-------

a2077a2369 Registers basic exception handler to handle early failures
2019-08-20 21:09:10 +02:00
Yonel Ceruto
a2077a2369 Registers basic exception handler to handle early failures 2019-08-20 14:56:58 -04:00
Nicolas Grekas
8073b8abfb some backports from master 2019-08-20 18:35:28 +02:00
Nicolas Grekas
31b668b8c4 minor #33255 Add return types to internal|final|private methods (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Add return types to internal|final|private methods

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

Related to #33228
This adds return-type declarations to internal, final and private methods.
Found by using a patched DebugClassLoader + manual edits.

Commits
-------

32116184d7 Add return types to internal|final|private methods
2019-08-20 17:40:49 +02:00