Commit Graph

38312 Commits

Author SHA1 Message Date
Nicolas Grekas
1c7eda4649 [DI] skip looking for config class when the extension class is anonymous 2019-12-19 11:27:02 +01:00
Fabien Potencier
5e9fa9d75e Fix typo 2019-12-19 10:48:27 +01:00
Fabien Potencier
bd9dc7c573 feature #35029 [DI] allow "." and "-" in env processor lines (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] allow "." and "-" in env processor lines

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

As explained in the linked issue, this is especially usefull with the `key` processor.

Commits
-------

231c505a47 [DI] allow "." and "-" in env processor lines
2019-12-19 08:07:55 +01:00
Nicolas Grekas
40c135125a bug #35021 [DI] Enable inline_class_loader in debug mode (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] Enable inline_class_loader in debug mode

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

Similar to https://github.com/symfony/recipes/pull/713
Check https://twitter.com/nicolasgrekas/status/929032213815005184
and https://github.com/symfony/symfony/pull/26276

Commits
-------

317ce6d16e [DI] Enable inline_class_loader in debug mode
2019-12-18 23:07:10 +01:00
Nicolas Grekas
b0eb6f36eb bug #35023 [HttpKernel] ignore failures generated by opcache.restrict_api (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] ignore failures generated by opcache.restrict_api

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

Commits
-------

e411b65dd0 [HttpKernel] ignore failuresgenerated by opcache.restrict_api
2019-12-18 22:42:09 +01:00
Nicolas Grekas
231c505a47 [DI] allow "." and "-" in env processor lines 2019-12-18 17:27:44 +01:00
Edi Modrić
d3d86ce250
Fix invalid typehint for subject in is_granted Twig function 2019-12-18 17:23:52 +01:00
Alexander McCullagh
9c5754acaa [Dotenv] FIX missing getenv 2019-12-18 16:41:13 +01:00
Saif Eddin G
776f649c61
[HttpFoundation] fix pdo session handler for sqlsrv 2019-12-18 16:15:58 +01:00
Thomas Calvet
c1746d8b14 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait 2019-12-18 16:09:34 +01:00
Nicolas Grekas
e411b65dd0 [HttpKernel] ignore failuresgenerated by opcache.restrict_api 2019-12-18 15:43:30 +01:00
Nicolas Grekas
9960f3032a Merge branch '5.0'
* 5.0:
  [Config] improve perf of glob discovery when GLOB_BRACE is not available
  use utf8mb4_bin to align code with documentation
  [HttpClient] make pushed responses retry-able
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:50:41 +01:00
Nicolas Grekas
c048ea5de5 Merge branch '4.4' into 5.0
* 4.4:
  [Config] improve perf of glob discovery when GLOB_BRACE is not available
  use utf8mb4_bin to align code with documentation
  [HttpClient] make pushed responses retry-able
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:50:31 +01:00
Nicolas Grekas
d7a0679011 bug #35015 [Config] fix perf of glob discovery when GLOB_BRACE is not available (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] fix perf of glob discovery when GLOB_BRACE is not available

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

This PR implements a fast fallback implementation of GLOB_BRACE for musl-based libc, as found on Alpine. It is *not* a feature-complete fallback implementation. Implementing one would be [much more involving](https://github.com/zendframework/zend-stdlib/blob/master/src/Glob.php). But the provided implementation is good enough in practice IMHO, and the slow path is still used when not-covered glob patterns are used.

Here is the comparison:
![image](https://user-images.githubusercontent.com/243674/71022909-eb9f7000-2101-11ea-99f5-eab0286c77a3.png)

![image](https://user-images.githubusercontent.com/243674/71022899-e4786200-2101-11ea-8663-80c1674602db.png)

Commits
-------

8af6d86371 [Config] improve perf of glob discovery when GLOB_BRACE is not available
2019-12-18 14:46:16 +01:00
Nicolas Grekas
b450a2bed7 Merge branch '4.3' into 4.4
* 4.3:
  use utf8mb4_bin to align code with documentation
  [HttpClient] make pushed responses retry-able
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:41:29 +01:00
Nicolas Grekas
bbf7ed12b1 bug #35014 [HttpClient] make pushed responses retry-able (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] make pushed responses retry-able

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/orgs/symfony/projects/1#card-30499375
| License       | MIT
| Doc PR        | -

This moves the PUSH matching logic down so that the curl handle of pushed responses can be properly configured. This should make pushed requests retry-able when they fail just after the push-promise frame.

Commits
-------

c2864f65ab [HttpClient] make pushed responses retry-able
2019-12-18 14:38:49 +01:00
Nicolas Grekas
026d57e196 Merge branch '3.4' into 4.3
* 3.4:
  use utf8mb4_bin to align code with documentation
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:36:54 +01:00
Nicolas Grekas
e85acddc9a bug #35010 [VarDumper] ignore failing __debugInfo() (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] ignore failing __debugInfo()

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

Commits
-------

eb2eb76d0e [VarDumper] ignore failing __debugInfo()
2019-12-18 14:29:30 +01:00
Robin Chalas
39bd706cbf feature #34548 Added access decision strategy to respect voter priority (aschempp)
This PR was squashed before being merged into the 5.1-dev branch (closes #34548).

Discussion
----------

Added access decision strategy to respect voter priority

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | _will happily do if this is of interest/to be merged 🙃_

The priority-based access decision strategy will decide based on the first voter that does not abstain from the decision. Security voters can be registered with priority (`PriorityTaggedServiceTrait`), so a voter with higher priority can overrule other voters.

In [Contao CMS](https://github.com/contao/contao), the core system should provide security voters that provide the "default permissions", but extensions/bundles can override almost anything and therefore need to be able to override the core decision. None of the existing strategies allow for something like that.

/ping @chalasr @Toflar @leofeyer @ausi
#SymfonyHackday

Commits
-------

0b8028a0ec Added access decision strategy to respect voter priority
2019-12-18 14:26:38 +01:00
Andreas Schempp
0b8028a0ec Added access decision strategy to respect voter priority 2019-12-18 14:26:30 +01:00
Nicolas Grekas
8af6d86371 [Config] improve perf of glob discovery when GLOB_BRACE is not available 2019-12-18 13:00:29 +01:00
Nicolas Grekas
317ce6d16e [DI] Enable inline_class_loader in debug mode 2019-12-18 12:53:53 +01:00
Ben Davies
3739ec9f29 use utf8mb4_bin to align code with documentation 2019-12-18 10:25:03 +00:00
Nicolas Grekas
c2864f65ab [HttpClient] make pushed responses retry-able 2019-12-17 17:19:12 +01:00
Nicolas Grekas
eb2eb76d0e [VarDumper] ignore failing __debugInfo() 2019-12-17 16:56:06 +01:00
Nicolas Grekas
76c98fda98 Merge branch '5.0'
* 5.0:
  [Console][QuestionHelper] Use string type declaration
2019-12-17 15:24:10 +01:00
Thomas Calvet
a594fe405b [Console][QuestionHelper] Use string type declaration 2019-12-17 14:20:22 +01:00
Nicolas Grekas
1b6c71200f Merge branch '5.0'
* 5.0:
  [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig
2019-12-17 13:18:30 +01:00
Nicolas Grekas
3c672bc923 Merge branch '4.4' into 5.0
* 4.4:
  [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig
2019-12-17 13:17:37 +01:00
Nicolas Grekas
32b09a8461 Merge branch '4.3' into 4.4
* 4.3:
  [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig
2019-12-17 13:17:04 +01:00
Nicolas Grekas
2b0f9d6bd9 [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig 2019-12-17 13:15:16 +01:00
Nicolas Grekas
8ffdef2958 Merge branch '5.0'
* 5.0:
  [DI] Service locators can't be decorated
  [HttpClient] force HTTP/1.1 when NTLM auth is used
  [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
  [DI] fix auto-binding service providers to their service subscribers
  [Mailer] fixed undefined index when sending mail
2019-12-17 11:36:18 +01:00
Nicolas Grekas
3c348df73b Merge branch '4.4' into 5.0
* 4.4:
  [DI] Service locators can't be decorated
  [HttpClient] force HTTP/1.1 when NTLM auth is used
  [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
  [DI] fix auto-binding service providers to their service subscribers
  [Mailer] fixed undefined index when sending mail
2019-12-17 11:33:13 +01:00
Nicolas Grekas
4b93c6210d Merge branch '4.3' into 4.4
* 4.3:
  [DI] Service locators can't be decorated
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
  [DI] fix auto-binding service providers to their service subscribers
2019-12-17 11:32:23 +01:00
Nicolas Grekas
91016348ba Merge branch '3.4' into 4.3
* 3.4:
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
2019-12-17 11:30:23 +01:00
Nicolas Grekas
8c74562dd8 bug #34998 [DI] fix auto-binding service providers to their service subscribers (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix auto-binding service providers to their service subscribers

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/orgs/symfony/projects/1#card-30503621
| License       | MIT
| Doc PR        | -

Spotted during a workshop at SymfonyLive Sao Paulo if I recall well :)

Commits
-------

6c2ceb0c44 [DI] fix auto-binding service providers to their service subscribers
2019-12-17 11:27:58 +01:00
Nicolas Grekas
07bfe6bae5 bug #34954 [Mailer] Fixed undefined index when sending via Mandrill API (wulff)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fixed undefined index when sending via Mandrill API

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

When a [Mandrill API send request](https://www.mandrillapp.com/api/docs/messages.JSON.html#method=send) is succesful, it returns an array of results, one for each recipient. To get rid of the undefined index error, we grab the message ID from the first recipient in the array.

Commits
-------

ef0aa4dc87 [Mailer] fixed undefined index when sending mail
2019-12-17 11:26:47 +01:00
Nicolas Grekas
672fbf5a2b bug #33670 [DI] Service locators can't be decorated (malarzm)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[DI] Service locators can't be decorated

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

This popped up while I was trying to update my work project as we have decorated the `messenger.receiver_locator` service. Not sure if this is a regression in DI or a change in messenger that caused the issue thus I'm not marking this as a BC break.

Exception while trying to compile the container:

```
Invalid definition for service "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratedServiceLocator": an array of references is expected as first argument when the "container.service_locator" tag is set.
```

Expected result: service locator can be decorated.

Commits
-------

343282b9d4 [DI] Service locators can't be decorated
2019-12-17 11:22:17 +01:00
Maciej Malarz
343282b9d4 [DI] Service locators can't be decorated 2019-12-17 11:22:10 +01:00
Nicolas Grekas
ae9c41cb16 bug #35000 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33928
| License       | MIT
| Doc PR        | -

Replaces / finishes https://github.com/symfony/symfony/pull/33911

Commits
-------

f175032ed8 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
2019-12-17 11:19:24 +01:00
Nicolas Grekas
cb96f143da bug #35005 [HttpClient] force HTTP/1.1 when NTLM auth is used (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] force HTTP/1.1 when NTLM auth is used

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

NTLM requires HTTP/1.1.

Commits
-------

0e87e9b960 [HttpClient] force HTTP/1.1 when NTLM auth is used
2019-12-17 11:18:26 +01:00
Nicolas Grekas
45d65cc000 feature #34881 [FrameworkBundle] Allow using the kernel as a registry of controllers and service factories (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Allow using the kernel as a registry of controllers and service factories

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #28992, fix #29997
| License       | MIT
| Doc PR        | -

This PR builds on #34873 and #34872 and allows using the `Kernel` as a registry of autowired controllers and service factories. The `ContainerConfigurator` passed to `configureContainer()` defaults to declaring autowired and autoconfigured services.

TL;DR: Silex is back but in a much more powerful way \o/

Here is a Kernel that just works and displays `Hello App\Foo` on the `/` route:
```php
class Kernel extends BaseKernel
{
    use MicroKernelTrait;

    protected function configureContainer(ContainerConfigurator $container): void
    {
        $container->services()
            ->load('App\\', '../src')
            ->set(Foo::class)
                ->factory([$this, 'createFoo']);
    }

    public function createFoo(Bar $bar)
    {
        return new Foo($bar);
    }

    protected function configureRoutes(RoutingConfigurator $routes): void
    {
        $routes->add('home', '/')->controller([$this, 'helloAction']);
    }

    public function helloAction(Foo $foo)
    {
        return new Response('Hello '.get_class($foo));
    }
}
```

Commits
-------

9c9b99cc65 [FrameworkBundle] Allow using the kernel as a registry of controllers and service factories
2019-12-17 11:12:34 +01:00
Nicolas Grekas
0e87e9b960 [HttpClient] force HTTP/1.1 when NTLM auth is used 2019-12-17 10:59:36 +01:00
Maxime Steinhausser
00b46fa72e [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces 2019-12-17 09:15:02 +01:00
fancyweb
f175032ed8 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
Co-authored-by: Mikhail Fesenko <m.fesenko@corp.vk.com>
2019-12-17 09:06:44 +01:00
Nicolas Grekas
6c2ceb0c44 [DI] fix auto-binding service providers to their service subscribers 2019-12-16 19:47:19 +01:00
Nicolas Grekas
a44f58bd79 Merge branch '5.0'
* 5.0:
  Fix displaying anonymous classes on PHP 7.4
  Fix merge
2019-12-16 15:48:59 +01:00
Nicolas Grekas
6fe308bb2a Merge branch '4.4' into 5.0
* 4.4:
  Fix displaying anonymous classes on PHP 7.4
  Fix merge
2019-12-16 15:48:47 +01:00
Nicolas Grekas
4e44baf1bb Merge branch '4.3' into 4.4
* 4.3:
  Fix displaying anonymous classes on PHP 7.4
2019-12-16 15:46:54 +01:00
Nicolas Grekas
c36568a1ed Fix displaying anonymous classes on PHP 7.4 2019-12-16 15:20:08 +01:00
Nicolas Grekas
57361a5ab8 Fix merge 2019-12-16 15:00:54 +01:00
Nicolas Grekas
0b23153f4f Merge branch '5.0'
* 5.0:
  Skip deprecations from doctrine/orm
  Ignore deprecations about doctrine/persistence coming from doctrine/orm
  skip not applicable tests
2019-12-16 14:35:24 +01:00
Nicolas Grekas
2e878378ef Merge branch '4.4' into 5.0
* 4.4:
  Skip deprecations from doctrine/orm
  Ignore deprecations about doctrine/persistence coming from doctrine/orm
  skip not applicable tests
2019-12-16 14:35:13 +01:00
Nicolas Grekas
0dea24fa8c Merge branch '4.3' into 4.4
* 4.3:
  Skip deprecations from doctrine/orm
  Ignore deprecations about doctrine/persistence coming from doctrine/orm
  skip not applicable tests
2019-12-16 14:34:43 +01:00
Nicolas Grekas
c8f3053be8 feature #34977 [EventDispatcher] Deprecate LegacyEventDispatcherProxy (derrabus)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[EventDispatcher] Deprecate LegacyEventDispatcherProxy

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Cleanup of #28920
| License       | MIT
| Doc PR        | N/A

> This class should be deprecated in Symfony 5.1

Well, here you go. 😃

Commits
-------

c7e612d4ad [EventDispatcher] Deprecate LegacyEventDispatcherProxy.
2019-12-16 12:38:33 +01:00
Christian Flothmann
f51538d581 minor #34994 [Validator] skip not applicable tests (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Validator] skip not applicable tests

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

Commits
-------

227c38180f skip not applicable tests
2019-12-16 12:34:11 +01:00
Christian Flothmann
227c38180f skip not applicable tests 2019-12-16 12:22:11 +01:00
Nicolas Grekas
700d2d39ca Merge branch '5.0'
* 5.0:
  Use `::class` constants instead of `__NAMESPACE__` when possible
2019-12-16 12:08:33 +01:00
Nicolas Grekas
4eadeb70a9 Merge branch '4.4' into 5.0
* 4.4:
  Use `::class` constants instead of `__NAMESPACE__` when possible
2019-12-16 12:08:25 +01:00
Nicolas Grekas
c05245d5a9 Merge branch '4.3' into 4.4
* 4.3:
  Use `::class` constants instead of `__NAMESPACE__` when possible
2019-12-16 12:07:37 +01:00
Nicolas Grekas
7d9945e24a Merge branch '3.4' into 4.3
* 3.4:
  Use `::class` constants instead of `__NAMESPACE__` when possible
2019-12-16 12:02:49 +01:00
Nicolas Grekas
cfd4194e20 minor #34990 Use ::class constants instead of __NAMESPACE__ when possible (fre5h)
This PR was merged into the 3.4 branch.

Discussion
----------

Use `::class` constants instead of `__NAMESPACE__` when possible

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Related to #34987
| License       | MIT
| Doc PR        | no

Form component has a lot of built-in form types. Some of them were implemented from the very beginning. In most of them there is a such method

```php
    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return __NAMESPACE__.'\TextType';
    }
```

This `getParent()` method was refactored in Symfony 2.8. The upgrade instructions are given here https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form

I think the `__NAMESPACE__.'\TextType';` expression was used because Symfony 2.8 was using `"php": ">=5.3.9"`, and the constant `::class` was added only in PHP 5.5

Now this line can be refactored into
```php
    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return TextType::class;
    }
```

For example new form types, that were added later, already using the `::class` constant.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/ColorType.php#L23
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/TelType.php#L23

So, in this pull request I propose to refactor all old form types to use `::class` constant. It will give a benefit during the future refactoring, because IDE or static analysers will find all usages of parent class. Unlike the `__NAMESPACE__.'\TextType';` line, which doesn't show the real link to the class for IDE or static analysers, and it could complicate finding all usages of parent class.

Commits
-------

32bf50abca Use `::class` constants instead of `__NAMESPACE__` when possible
2019-12-16 11:55:12 +01:00
Nicolas Grekas
be0e04b84a Merge branch '5.0'
* 5.0: (21 commits)
  fix merge
  CS
  [FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
  [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
  stop using deprecated Doctrine persistence classes
  [Cache] Fix wrong classname in deprecation message
  Fix regex lookahead syntax in ApplicationTest
  Fixed syntax in comment
  [SecurityBundle][FirewallMap] Remove unused property
  [Messenger][AMQP] Use delivery_mode=2 by default
  [FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
  [SECURITY] Revert "AbstractAuthenticationListener.php error instead info. Rebase of #28462"
  [FrameworkBundle][Secrets] Hook configured local dotenv file
  [DI] Improve performance of processDefinition
  fix redis multi host dsn not recognized
  fix constructor argument type declaration
  Fix invalid Windows path normalization
  [Validator][ConstraintValidator] Safe fail on invalid timezones
  [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
  [FrameworkBundle] Add info & example to auto_mapping config
  ...
2019-12-16 11:48:49 +01:00
Nicolas Grekas
525d7bf716 Merge branch '4.4' into 5.0
* 4.4: (21 commits)
  fix merge
  CS
  [FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
  [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
  stop using deprecated Doctrine persistence classes
  [Cache] Fix wrong classname in deprecation message
  Fix regex lookahead syntax in ApplicationTest
  Fixed syntax in comment
  [SecurityBundle][FirewallMap] Remove unused property
  [Messenger][AMQP] Use delivery_mode=2 by default
  [FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
  [SECURITY] Revert "AbstractAuthenticationListener.php error instead info. Rebase of #28462"
  [FrameworkBundle][Secrets] Hook configured local dotenv file
  [DI] Improve performance of processDefinition
  fix redis multi host dsn not recognized
  fix constructor argument type declaration
  Fix invalid Windows path normalization
  [Validator][ConstraintValidator] Safe fail on invalid timezones
  [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
  [FrameworkBundle] Add info & example to auto_mapping config
  ...
2019-12-16 11:47:49 +01:00
Nicolas Grekas
68681e49f2 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
  CS
  [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
  stop using deprecated Doctrine persistence classes
  [Cache] Fix wrong classname in deprecation message
  Fix regex lookahead syntax in ApplicationTest
  Fixed syntax in comment
  [SecurityBundle][FirewallMap] Remove unused property
  [Messenger][AMQP] Use delivery_mode=2 by default
  [DI] Improve performance of processDefinition
  Fix invalid Windows path normalization
  [Validator][ConstraintValidator] Safe fail on invalid timezones
  [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
  [FrameworkBundle] Add info & example to auto_mapping config
  fix comparisons with null values at property paths
2019-12-16 11:45:21 +01:00
Nicolas Grekas
64410edfb3 fix merge 2019-12-16 11:44:01 +01:00
Nicolas Grekas
02c1cda67e Merge branch '3.4' into 4.3
* 3.4:
  CS
  [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
  stop using deprecated Doctrine persistence classes
  Fix regex lookahead syntax in ApplicationTest
  [SecurityBundle][FirewallMap] Remove unused property
  [DI] Improve performance of processDefinition
  Fix invalid Windows path normalization
  [Validator][ConstraintValidator] Safe fail on invalid timezones
  [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
  fix comparisons with null values at property paths
2019-12-16 11:33:29 +01:00
Artem Henvald
32bf50abca Use ::class constants instead of __NAMESPACE__ when possible 2019-12-16 11:25:54 +01:00
Christian Flothmann
a073606ea8 bug #29839 [Validator] fix comparisons with null values at property paths (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] fix comparisons with null values at property paths

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

Commits
-------

ffa5db74c1 fix comparisons with null values at property paths
2019-12-16 09:55:48 +01:00
Robin Chalas
ab8841e248 minor #34991 CS for AccessDecisionManager (aschempp)
This PR was merged into the 3.4 branch.

Discussion
----------

CS for AccessDecisionManager

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

As discussed in #34548 with @nicolas-grekas here's a CS change for the `AccessDecisionManager`

Commits
-------

b3742ec493 CS
2019-12-16 00:50:24 +01:00
Alexander M. Turek
c7e612d4ad [EventDispatcher] Deprecate LegacyEventDispatcherProxy. 2019-12-15 23:54:05 +01:00
Andreas Schempp
b3742ec493 CS 2019-12-15 22:30:08 +01:00
gauss
0e92399daa [DI] Suggest typed argument when binding fails with untyped argument 2019-12-15 19:13:51 +01:00
Thomas Calvet
6986394042 [FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported 2019-12-15 18:41:51 +01:00
Fabien Potencier
af39d09ed7 minor #34887 [FrameworkBundle] Add info & example to auto_mapping config (ogizanagi)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] Add info & example to auto_mapping config

| Q             | A
| ------------- | ---
| Branch?       | 4.3 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | N/A <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Backport part of #34707 and add example.

Commits
-------

8eb29a7b73 [FrameworkBundle] Add info & example to auto_mapping config
2019-12-15 14:50:41 +01:00
Fabien Potencier
658c714f77 bug #34900 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge] Fixed submitting invalid ids when using queries with limit

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #31559 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | ~
<!--
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):
 - 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 master.
-->

Commits
-------

09bb1e49d8 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
2019-12-15 14:49:19 +01:00
Fabien Potencier
8f42a7679d bug #34791 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #34791).

Discussion
----------

[Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer

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

When trying to read from an uninitialized property in PHP 7.4, a `TypeError` is generated, see https://wiki.php.net/rfc/typed_properties_v2#uninitialized_and_unset_properties. This PR fixes the issue.

Commits
-------

1ed8e42d15 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
2019-12-15 14:47:04 +01:00
Valentin Udaltsov
1ed8e42d15 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer 2019-12-15 14:46:58 +01:00
Fabien Potencier
91f79e269d bug #34956 [Messenger][AMQP] Use delivery_mode=2 by default (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger][AMQP] Use delivery_mode=2 by default

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

Commits
-------

be2eb6fcc7 [Messenger][AMQP] Use delivery_mode=2 by default
2019-12-15 14:44:54 +01:00
Fabien Potencier
00c775e271 bug #34915 [FrameworkBundle] Fix invalid Windows path normalization in TemplateNameParser (mvorisek)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix invalid Windows path normalization in TemplateNameParser

| Q             | A
| ------------- | ---
| Branch?       | 3.4 - <5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | Fix invalid Windows path normalization

All versions of Symfony until 5.0 (which does no longer do extra file path normalization) normalize Windows paths wrongly.

See https://github.com/PrestaShop/PrestaShop/issues/16736 and https://bugs.php.net/bug.php?id=78939

Currently this issue can be observed when Symfony is run by NTS PHP only, but once the PHP issue will be fixed, this issue will probably affects all Windows users when absolute template name is passed to Symfony templating.

Commits
-------

130df8ca8c Fix invalid Windows path normalization
2019-12-15 14:43:43 +01:00
Nicolas Grekas
2ecdc3ac36 minor #34966 [DI] Improve performance of processDefinition (Stefan Kruppa)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Improve performance of processDefinition

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

Saves some time during container compilation by instantiating the reflection class only once. In my case this speeds up container compilation in dev mode by ~10% (saves almost 100k calls to `getReflectionClass`).

Tests still run locally and my compiled container was identical pre and post change, but I found this improvement by Blackfire profiling and am not familiar with the surrounding code, so it would be great if someone could doublecheck if the change causes problems.

Commits
-------

41b56eac29 [DI] Improve performance of processDefinition
2019-12-15 11:05:21 +01:00
Nicolas Grekas
28bf18089a minor #34976 Fix regex lookahead syntax in ApplicationTest (guilliamxavier)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix regex lookahead syntax in ApplicationTest

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no (test fix)
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

`(?>!1)` is actually an atomic group for literal `!1`.
`(?!1)` is a negative lookahead assertion for literal `1`.

Commits
-------

cf1d7b2ed1 Fix regex lookahead syntax in ApplicationTest
2019-12-15 10:58:22 +01:00
Nicolas Grekas
2b40bb4f4e bug #34981 stop using deprecated Doctrine persistence classes (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

stop using deprecated Doctrine persistence classes

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

Commits
-------

4db5f022a1 stop using deprecated Doctrine persistence classes
2019-12-15 10:51:14 +01:00
Christian Flothmann
4db5f022a1 stop using deprecated Doctrine persistence classes 2019-12-15 08:53:25 +01:00
Anto
c7115a3087
[Cache] Fix wrong classname in deprecation message 2019-12-14 09:13:00 +01:00
Guilliam Xavier
cf1d7b2ed1
Fix regex lookahead syntax in ApplicationTest 2019-12-13 21:47:04 +01:00
Tobias Nyholm
20f9a5bbb0
Fixed syntax in comment 2019-12-13 20:25:45 +01:00
Thomas Calvet
0904e57b85 [SecurityBundle][FirewallMap] Remove unused property 2019-12-13 17:57:31 +01:00
Grégoire Pineau
be2eb6fcc7 [Messenger][AMQP] Use delivery_mode=2 by default 2019-12-13 14:40:46 +01:00
Nicolas Grekas
9c9b99cc65 [FrameworkBundle] Allow using the kernel as a registry of controllers and service factories 2019-12-13 14:13:08 +01:00
Nicolas Grekas
cf45eeccfc [FrameworkBundle] Allow using a ContainerConfigurator in MicroKernelTrait::configureContainer() 2019-12-13 14:10:14 +01:00
Nicolas Grekas
44458126b5 feature #34872 [FrameworkBundle] Added flex-compatible default implementations for MicroKernelTrait::registerBundles() and getProjectDir() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Added flex-compatible default implementations for `MicroKernelTrait::registerBundles()` and `getProjectDir()`

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

I think it's safe now to migrate some flex-based defaults from the recipe to the bundle.
No BC break here as all existing kernels already redefine this method.

Commits
-------

a689807387 [FrameworkBundle] Added flex-compatible default implementations for `MicroKernelTrait::registerBundles()` and `getProjectDir()`
2019-12-13 14:08:39 +01:00
Nicolas Grekas
a689807387 [FrameworkBundle] Added flex-compatible default implementations for MicroKernelTrait::registerBundles() and getProjectDir() 2019-12-13 13:53:25 +01:00
Nicolas Grekas
e04331657f bug #34904 [Validator][ConstraintValidator] Safe fail on invalid timezones (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator][ConstraintValidator] Safe fail on invalid timezones

Co-authored-by: Scott Dawson <scott@loyaltycorp.com.au>

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33901
| License       | MIT
| Doc PR        |

Alternative to https://github.com/symfony/symfony/pull/33902.

I will explain why I think it is better this way:

1. We set the timezone with the setter because it's 100% safe, it never fails. It fall backs to the default timezone if the provided timezone is not supported (as if we passed null, so the same behavior that always existed). We are therefore compatible with all edge cases.
2. We don't validate the timezone with `\DateTimeZone::listIdentifiers()`. It only returns full identifiers like "Europe/Paris" but it doesn't take into account "numeric" identifiers such as "+08:00" which are perfectly valid. I added a test case to ensure we stay valid with this case. + some invalid identifiers for the native `\IntlDateFormatter` are valid with the polyfill that uses `\DateTimeZone` (eg : `X`). I don't think we can validate anything safely that will work reliably on both implementations.

Commits
-------

3b1b994cb3 [Validator][ConstraintValidator] Safe fail on invalid timezones
2019-12-13 13:34:40 +01:00
Nicolas Grekas
da7dedaaa0 bug #34935 [FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34858
| License       | MIT
| Doc PR        | -

We remove the "removing" passes again and to avoid what https://github.com/symfony/symfony/pull/34502 fixed, we skip validating the "live" container removed ids in the pass (the "live" container is supposed to have the same definitions than the "debug container" one).

Logically, an errored service cannot pass the "live" container compilation without being removed. Consequently, it also skips the errored services that ended up being removed in the "live" container.

Commits
-------

a0f581ba9d [FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
2019-12-13 13:19:04 +01:00
Thomas Calvet
a0f581ba9d [FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass 2019-12-13 13:18:52 +01:00
Diego Aguiar
9d306f9046 [SECURITY] Revert "AbstractAuthenticationListener.php error instead info. Rebase of #28462"
This reverts commit 867eb78cfe.
2019-12-13 13:11:48 +01:00
Nicolas Grekas
a6d15678f9 feature #34916 [DI] Add support for defining method calls in InlineServiceConfigurator (Lctrs)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[DI] Add support for defining method calls in InlineServiceConfigurator

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

Commits
-------

5af6e21529 [DI] Add support for defining method calls in InlineServiceConfigurator
2019-12-13 13:09:24 +01:00
Lctrs
5af6e21529 [DI] Add support for defining method calls in InlineServiceConfigurator 2019-12-13 13:09:17 +01:00
Nicolas Grekas
1d59e1eff0 bug #34922 [FrameworkBundle][Secrets] Hook configured local dotenv file (fancyweb)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][Secrets] Hook configured local dotenv file

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34905
| License       | MIT
| Doc PR        | -

Configured local_dotenv_file does not currently substitute the secrets.vault service definition first argument value, rendering this configuration option useless + we don't need to set defaults in secrets.xml since everything is overriden in FrameworkExtension with the same default values (from the configuration).

Commits
-------

56f542c36b [FrameworkBundle][Secrets] Hook configured local dotenv file
2019-12-13 13:07:54 +01:00
Thomas Calvet
56f542c36b [FrameworkBundle][Secrets] Hook configured local dotenv file 2019-12-13 13:07:46 +01:00
Stefan Kruppa
41b56eac29 [DI] Improve performance of processDefinition 2019-12-13 12:59:23 +01:00
Nicolas Grekas
212dc53431 bug #34967 [HttpFoundation] fix redis multi host dsn not recognized (Jan Christoph Beyer)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] fix redis multi host dsn not recognized

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

#34177 added support configurating session handlers with DSNs. It was no possible to pass a redis-DSN like
`redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'`

since the check was
`case 0 === strpos($connection, 'redis://'):`

Commits
-------

81ba07aa26 fix redis multi host dsn not recognized
2019-12-13 12:54:36 +01:00
Jan Christoph Beyer
81ba07aa26 fix redis multi host dsn not recognized 2019-12-13 12:54:15 +01:00
Nicolas Grekas
0636177aa6 bug #34963 [Lock] fix constructor argument type declaration (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] fix constructor argument type declaration

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

Commits
-------

201af4f31d fix constructor argument type declaration
2019-12-13 12:50:28 +01:00
Christian Flothmann
201af4f31d fix constructor argument type declaration 2019-12-13 09:10:41 +01:00
Nicolas Grekas
9393c5d091 Merge branch '5.0'
* 5.0:
  Fix merge
2019-12-12 16:25:11 +01:00
Nicolas Grekas
e8282537c0 Fix merge 2019-12-12 16:25:01 +01:00
Nicolas Grekas
331765b95d Merge branch '5.0'
* 5.0:
  Fix leftover from doctrine/persistence < 1.3
  Require doctrine/persistence ^1.3
2019-12-12 16:10:59 +01:00
Nicolas Grekas
9a88f527a6 Merge branch '4.4' into 5.0
* 4.4:
  Fix leftover from doctrine/persistence < 1.3
  Require doctrine/persistence ^1.3
2019-12-12 16:09:39 +01:00
Nicolas Grekas
96f04d9b32 Fix leftover from doctrine/persistence < 1.3 2019-12-12 16:05:14 +01:00
Nicolas Grekas
866de0fb8b Merge branch '4.3' into 4.4
* 4.3:
  Require doctrine/persistence ^1.3
2019-12-12 16:02:38 +01:00
Nicolas Grekas
ce5dcb96c1 Require doctrine/persistence ^1.3 2019-12-12 15:53:41 +01:00
Morten Wulff
ef0aa4dc87 [Mailer] fixed undefined index when sending mail
When a Mandrill API request is succesful, it returns an array of
results, one for each recipient. To get rid of the undefined index
error, we grab the message ID from the first recipient in the array.
2019-12-12 15:08:08 +01:00
Nicolas Grekas
5690b97f7a [Lock] Fix merge 2019-12-12 14:59:51 +01:00
Nicolas Grekas
20811cea21 Merge branch '5.0'
* 5.0:
  [Messenger] Fix deprecation
2019-12-12 14:56:34 +01:00
Nicolas Grekas
5b06e01348 Merge branch '4.4' into 5.0
* 4.4:
  [Messenger] Fix deprecation
2019-12-12 14:55:59 +01:00
Nicolas Grekas
a656a57736 [Messenger] Fix deprecation 2019-12-12 14:54:44 +01:00
Nicolas Grekas
a8b6ba3609 Merge branch '5.0'
* 5.0:
  Add missing annotation
  Fix merge
2019-12-12 14:37:04 +01:00
Nicolas Grekas
0370699cea Merge branch '4.4' into 5.0
* 4.4:
  Add missing annotation
  Fix merge
2019-12-12 14:36:53 +01:00
Nicolas Grekas
12f46ba538 Merge branch '4.3' into 4.4
* 4.3:
  Add missing annotation
2019-12-12 14:35:29 +01:00
Nicolas Grekas
80d15cdcf9 Merge branch '3.4' into 4.3
* 3.4:
  Add missing annotation
2019-12-12 14:34:31 +01:00
Nicolas Grekas
4ec093abc8 Add missing annotation 2019-12-12 14:33:51 +01:00
Nicolas Grekas
93b2f9ef6f Merge branch '4.3' into 4.4
* 4.3:
  Fix merge
2019-12-12 14:26:43 +01:00
Nicolas Grekas
7d88be8978 Fix merge 2019-12-12 14:16:57 +01:00
Nicolas Grekas
b94f9e5868 Merge branch '5.0'
* 5.0:
  Fix merge
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [DI] Add support for immutable setters in CallTrait
  [Cache] Propagate expiry when syncing items in ChainAdapter
  Removed request header "Content-Type" from the preferred format guessing mechanism
  [Routing] fix memoryleak when loading compiled routes
  [Translation] fix memoryleak in PhpFileLoader
  fix triggering deprecation in file locator
  bug #34877 [TwigBundle] fix findTemplate() to return `null`
2019-12-12 14:04:26 +01:00
Nicolas Grekas
cf073e563f Merge branch '4.4' into 5.0
* 4.4:
  Fix merge
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [DI] Add support for immutable setters in CallTrait
  [Cache] Propagate expiry when syncing items in ChainAdapter
  Removed request header "Content-Type" from the preferred format guessing mechanism
  [Routing] fix memoryleak when loading compiled routes
  [Translation] fix memoryleak in PhpFileLoader
  fix triggering deprecation in file locator
  bug #34877 [TwigBundle] fix findTemplate() to return `null`
2019-12-12 14:03:32 +01:00
Nicolas Grekas
a31119b89c Merge branch '4.3' into 4.4
* 4.3:
  Fix merge
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [DI] Add support for immutable setters in CallTrait
  [Cache] Propagate expiry when syncing items in ChainAdapter
  [Routing] fix memoryleak when loading compiled routes
  [Translation] fix memoryleak in PhpFileLoader
2019-12-12 13:53:52 +01:00
Nicolas Grekas
ad4b5fd653 Fix merge 2019-12-12 13:43:22 +01:00
Nicolas Grekas
72936e457f Merge branch '3.4' into 4.3
* 3.4:
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [Translation] fix memoryleak in PhpFileLoader
2019-12-12 13:39:14 +01:00
Nicolas Grekas
53a4711520 [DoctrineBridge] try to fix deprecations from doctrine/persistence 2019-12-12 13:13:32 +01:00
Nicolas Grekas
d294085689 bug #34923 [DI] Fix support for immutable setters in CallTrait (Lctrs)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Fix support for immutable setters in CallTrait

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

Commits
-------

90ace51328 [DI] Add support for immutable setters in CallTrait
2019-12-11 13:26:30 +01:00
Lctrs
90ace51328 [DI] Add support for immutable setters in CallTrait 2019-12-11 13:18:17 +01:00
Fabien Potencier
93f430b94f Fix CS 2019-12-11 01:47:24 +01:00
Joe Bennett
a6bfa5931e [Lock] add mongodb store 2019-12-11 01:40:35 +01:00
Fabien Potencier
25494fa519 bug #34878 [TwigBundle] fix broken FilesystemLoader::exists() with Twig 3 (dpesch)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBundle] fix broken FilesystemLoader::exists() with Twig 3

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

This fix adapts the declaration of Twig 3 `\Twig\Loader\FilesystemLoader::findTemplate()` which expects to return `string|null` and returns `null` instead of `false`.

Returning `false` breaks `\Twig\Loader\FilesystemLoader::exists()` which returns `true` if `findTemplate()` does not return `null`.

Twig 2 should not be affected by this patch. The `exists()` method expects `null` or `false` for not found templates: <fdb691a424/src/Loader/FilesystemLoader.php (L169)>

Commits
-------

ff1d77e155 bug #34877 [TwigBundle] fix findTemplate() to return `null`
2019-12-11 01:24:49 +01:00
Fabien Potencier
d91efd31f6 bug #34921 [HttpFoundation] Removed "Content-Type" from the preferred format guessing mechanism (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Removed "Content-Type" from the preferred format guessing mechanism

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

Confirmed, inferring the `Content-Type` of the response using the `Content-Type` provided for the request body is NOT a good idea. The HTTP RFC explicitly states that `Accept` must be used to hint a preferred response format (`Content-Type` on the request indicates the type of associated its the body).

Use `Accept` if provided (a best practice anyway), and fallback to the default value (HTML by default) otherwise.

Commits
-------

776523e56a Removed request header "Content-Type" from the preferred format guessing mechanism
2019-12-11 01:19:19 +01:00
Fabien Potencier
6bf764a4ed bug #34886 [HttpKernel] fix triggering deprecation in file locator (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] fix triggering deprecation in file locator

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

Commits
-------

142b1793e0 fix triggering deprecation in file locator
2019-12-11 01:18:36 +01:00
Fabien Potencier
349ea047e6 bug #34918 [Translation] fix memoryleak in PhpFileLoader (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] fix memoryleak in PhpFileLoader

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

This happens when running the test suite with opcache disabled (as it is the case by default since `opcache.enable_cli=0`).
Doing this "require" in a loop (for each test case) compiles the file at each iteration and doesn't reclaim memory (there is no garbage collector for opcodes).

Commits
-------

5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader
2019-12-11 01:14:09 +01:00
Fabien Potencier
ebadf51543 bug #34920 [Routing] fix memoryleak when loading compiled routes (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix memoryleak when loading compiled routes

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

Same as #34918 for Routing. That's the last significant memory hog I've identified.

Commits
-------

85371a174e [Routing] fix memoryleak when loading compiled routes
2019-12-11 01:13:19 +01:00
Javier Eguiluz
24f32f8bf8 [ErrorHandler] Enabled the dark theme for exception pages 2019-12-10 17:56:21 +01:00
Trevor North
77138acea6 [Cache] Propagate expiry when syncing items in ChainAdapter
If a lower adapter provides item metadata, propagate the expiry time when
syncing the item to upper ones.
2019-12-10 17:45:08 +01:00
Nicolas Grekas
65a988880d Merge branch '5.0'
* 5.0:
  Fix CS
2019-12-10 16:15:37 +01:00
Nicolas Grekas
af04885358 Merge branch '4.4' into 5.0
* 4.4:
  Fix CS
2019-12-10 16:15:29 +01:00
Nicolas Grekas
648544f432 Merge branch '4.3' into 4.4
* 4.3:
  Fix CS
2019-12-10 16:11:53 +01:00
Nicolas Grekas
5da657bcf3 Merge branch '3.4' into 4.3
* 3.4:
  Fix CS
2019-12-10 16:11:12 +01:00
Nicolas Grekas
c90cf3301a Fix CS 2019-12-10 16:06:53 +01:00
Yonel Ceruto
776523e56a Removed request header "Content-Type" from the preferred format guessing mechanism 2019-12-10 09:58:16 -05:00
Nicolas Grekas
85371a174e [Routing] fix memoryleak when loading compiled routes 2019-12-10 15:07:26 +01:00
Nicolas Grekas
2df13e1735 Merge branch '5.0'
* 5.0:
  [Cache] fix merge
2019-12-10 14:56:31 +01:00
Nicolas Grekas
418b8d9b7a [Cache] fix merge 2019-12-10 14:56:26 +01:00
Nicolas Grekas
c7d8accc9b Merge branch '5.0'
* 5.0:
  [Validator] fix low deps
  Don't patch BadFileName.php fixture file
2019-12-10 14:45:02 +01:00
Nicolas Grekas
c6eae73d15 Merge branch '4.4' into 5.0
* 4.4:
  [Validator] fix low deps
  Don't patch BadFileName.php fixture file
2019-12-10 14:44:54 +01:00
Nicolas Grekas
4c50968dd8 [Validator] fix low deps 2019-12-10 14:43:13 +01:00
Michael Voříšek
130df8ca8c Fix invalid Windows path normalization 2019-12-10 14:02:44 +01:00
Nicolas Grekas
5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader 2019-12-10 13:51:10 +01:00
Christian Flothmann
142b1793e0 fix triggering deprecation in file locator 2019-12-10 13:26:43 +01:00
Dominik Pesch
ff1d77e155 bug #34877 [TwigBundle] fix findTemplate() to return null
Twig3 FilesystemLoader::findTemplate() should return `string|null`
instead of Twig2 `string|null|false`: see
<https://github.com/twigphp/Twig/blob/3.x/src/Loader/FilesystemLoader.php#L167>

Returning `null` fixes `exists()` of Twig 3 FilesystemLoader without
breaking Twig 2 (which expected `null` or `false` for not found
templates).

Change the test to assert `null` instead of `false`.
2019-12-10 12:13:11 +01:00
Nicolas Grekas
c2181b0887 Merge branch '5.0'
* 5.0:
  [Validator] Fix auto-mapping constraints should not be validated
  [Debug] Updated the README to deprecate the component
  [Cache] fix memory leak when using PhpFilesAdapter
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  Fixing bad order of operations with null coalescing operator
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
  [Process] change the syntax of portable prepared command lines
  [MonologBridge] Fix debug processor datetime type
2019-12-10 12:07:17 +01:00
Nicolas Grekas
5f50769825 Merge branch '4.4' into 5.0
* 4.4:
  [Validator] Fix auto-mapping constraints should not be validated
  [Debug] Updated the README to deprecate the component
  [Cache] fix memory leak when using PhpFilesAdapter
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  Fixing bad order of operations with null coalescing operator
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
  [Process] change the syntax of portable prepared command lines
  [MonologBridge] Fix debug processor datetime type
2019-12-10 12:06:55 +01:00
Nicolas Grekas
ea5ad5c40b minor #34912 [Debug] Updated the README to deprecate the component (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] Updated the README to deprecate the component

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | https://github.com/symfony/symfony-docs/issues/12775
| License       | MIT
| Doc PR        | -

Commits
-------

ab9e0eb2f5 [Debug] Updated the README to deprecate the component
2019-12-10 12:00:13 +01:00
Nicolas Grekas
7049b94aed bug #34694 [Validator] Fix auto-mapping constraints should not be validated (ogizanagi)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Validator] Fix auto-mapping constraints should not be validated

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | #34672 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

As for `Traverse`, I don't think we should add these "constraints" to the list.

I'm also wondering if it really makes sense to have these annotations as constraints. I think it should rather behave like the `GroupSequence` annotation to add the info the generic metadata at loading time, but we don't need to rely on the constraints behavior at all.

Commits
-------

bc53e4bca0 [Validator] Fix auto-mapping constraints should not be validated
2019-12-10 11:58:52 +01:00
Maxime Steinhausser
bc53e4bca0 [Validator] Fix auto-mapping constraints should not be validated 2019-12-10 11:58:45 +01:00
Nicolas Grekas
2e7032420f bug #34848 [Process] change the syntax of portable command lines (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Process] change the syntax of portable command lines

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34838
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12772

An alternative to #34845

Right now, portable command lines use `"$FOO"` for placeholders.
But because we validate that a corresponding variable exists before running the command, this fails with `Command line is missing a value for key "$FOO"` when `FOO` is not defined.

This PR proposes to use `"${:FOO}"` instead. The difference with the previous syntax is that this cannot collide with existing shell scripts as it is invalid for them.

When this is merged, we'll have to update https://symfony.com/blog/new-in-symfony-4-1-prepared-commands too.

Commits
-------

3c7b775b3e [Process] change the syntax of portable prepared command lines
2019-12-10 11:51:39 +01:00
Nicolas Grekas
b81f4280df bug #34862 [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared

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

Some bundles extensions are "instances dependents", eg they cache service registrations (eg: 70dec3c8a3/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php (L743)).

Launching the lint command loads all bundles a first time, just to be able to run the command.

Then, when we build the container again for the lint command, it loads all bundles a second time. But since it's the same bundles instances, some services are not registered, leading to missing services in `CheckExceptionOnInvalidReferenceBehaviorPass`.

Commits
-------

31975e4981 [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
2019-12-10 11:48:48 +01:00
Javier Eguiluz
ab9e0eb2f5 [Debug] Updated the README to deprecate the component 2019-12-10 11:48:09 +01:00
Nicolas Grekas
e77059825c Merge branch '4.3' into 4.4
* 4.3:
  [Cache] fix memory leak when using PhpFilesAdapter
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [MonologBridge] Fix debug processor datetime type
2019-12-10 11:33:21 +01:00
Nicolas Grekas
7f2d9c2b1e Merge branch '3.4' into 4.3
* 3.4:
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [MonologBridge] Fix debug processor datetime type
2019-12-10 11:30:59 +01:00
Nicolas Grekas
5aff4a66f1 bug #34896 [Cache] fix memory leak when using PhpFilesAdapter (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fix memory leak when using PhpFilesAdapter

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

Similar to #34839 but for `PhpFilesAdapter`, as the "appendOnly" mode is a v4-only feature.

Commits
-------

0b46226648 [Cache] fix memory leak when using PhpFilesAdapter
2019-12-10 11:24:37 +01:00
Nicolas Grekas
0b46226648 [Cache] fix memory leak when using PhpFilesAdapter 2019-12-10 11:09:22 +01:00
Nicolas Grekas
42712ee006 bug #34438 [HttpFoundation] Use Cache-Control: must-revalidate only if explicit lifetime has been given (mpdude)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given

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

This is really nit-picking: The conservative, safe default for `Cache-Control` is `private, no-cache` which means the response must not be served from cache unless it has been validated.

If `Last-Modified` or `Expires` are present, we can relax `no-cache` to be `must-revalidate`, which means that _once the response has become stale_, it must be revalidated.

An `ETag` alone does not give the response a lifetime, so IMO sticking with `no-cache` in this case would be more consistent.

Commits
-------

1b1002b426 [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
2019-12-10 10:07:44 +01:00
Nicolas Grekas
035d8a3925 bug #34449 [Yaml] Implement multiline string as scalar block for tagged values (natepage)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Yaml] Implement multiline string as scalar block for tagged values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT

At the moment you can parse a tagged value defined as a scalar block. But you can't actually dump a multiline string as scalar block when using a tagged value.

This PR implements the multiline string as scalar block for tagged values as well.

Commits
-------

84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values
2019-12-10 09:51:28 +01:00
natepage
84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values 2019-12-10 09:51:22 +01:00
Matthias Pigulla
1b1002b426 [HttpFoundation] Use Cache-Control: must-revalidate only if explicit lifetime has been given 2019-12-10 09:49:31 +01:00
Thomas Calvet
3b1b994cb3 [Validator][ConstraintValidator] Safe fail on invalid timezones
Co-authored-by: Scott Dawson <scott@loyaltycorp.com.au>
2019-12-10 09:48:07 +01:00
Nicolas Grekas
8aefe97a89 bug #34601 [MonologBridge] Fix debug processor datetime type (mRoca)
This PR was merged into the 3.4 branch.

Discussion
----------

[MonologBridge] Fix debug processor datetime type

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

This PR fixes an eventual `Call to a member function getTimestamp() on string` if any Processor transforms the `datetime` value, and uses the same record conditions as in the [ConsoleFormatter](https://github.com/symfony/monolog-bridge/blob/master/Formatter/ConsoleFormatter.php#L118 )

Commits
-------

ffe3f10780 [MonologBridge] Fix debug processor datetime type
2019-12-10 09:37:56 +01:00
Nicolas Grekas
cd433461cf minor #34723 [FrameworkBundle] Use UserInterface to @return in getUser method (Arman-Hosseini)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Use UserInterface to @return in getUser method

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT
<!--
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):
 - 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 master.
-->

Commits
-------

9f1ebd7fb9 [FrameworkBundle] Use UserInterface to @return in getUser method
2019-12-10 09:25:53 +01:00
Arman Hosseini
9f1ebd7fb9 [FrameworkBundle] Use UserInterface to @return in getUser method 2019-12-10 09:25:47 +01:00
Nicolas Grekas
2eacbc5b54 bug #34842 [ExpressionLanguage] Process division by zero (tigr1991)
This PR was merged into the 3.4 branch.

Discussion
----------

[ExpressionLanguage] Process division by zero

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

To be able to catch the error in expression like ` 1 / 0`

**Before PR:**
```
try {
    1 / 0;
} catch (\Throwable $e) {
    // It won't be caught anyway
    // PHP Warning:  Division by zero in...
}

try {
    1 % 0;
} catch (\Throwable $e) {
    // It will be caught since PHP7
    // \DivisionByZeroError with message `Modulo by zero`
}
```
**After PR:**
```
try {
    1 / 0;
} catch (\Throwable $e) {
    // It will be caught
    // \DivisionByZeroError with message `Division by zero`
}

try {
    1 % 0;
} catch (\Throwable $e) {
    // It will be caught
    // \DivisionByZeroError with message `Modulo by zero`
}
```

Commits
-------

02ab72ab30 [ExpressionLanguage][Node][BinaryNode] Process division by zero
2019-12-10 09:19:19 +01:00
Ivan
02ab72ab30 [ExpressionLanguage][Node][BinaryNode] Process division by zero 2019-12-10 09:18:51 +01:00
Nicolas Grekas
429b18e28e minor #34895 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime

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

Since we format the \DateTimeImmutable with the "e" character, it uses this timezone identifier and do not consider the passed one. See https://www.php.net/manual/en/datetime.construct.php:

> The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00).

Commits
-------

03dbcf8794 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
2019-12-10 09:11:51 +01:00
Nicolas Grekas
56bfbd8377 bug #34902 [PropertyAccess] forward caught exception (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess] forward caught exception

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

Commits
-------

98e18d33df forward caught exception
2019-12-10 09:05:46 +01:00
Jules Pietri
09bb1e49d8 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit 2019-12-09 22:44:57 +01:00
Ryan Weaver
629126435d Fixing bad order of operations with null coalescing operator 2019-12-09 15:51:18 -05:00
Christian Flothmann
98e18d33df forward caught exception 2019-12-09 21:23:16 +01:00
Maxime Steinhausser
8eb29a7b73 [FrameworkBundle] Add info & example to auto_mapping config 2019-12-09 15:21:32 +01:00
Thomas Calvet
03dbcf8794 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime 2019-12-09 14:42:15 +01:00
Christian Flothmann
e1145a78b5 add tags before processing them 2019-12-09 10:36:27 +01:00
Nicolas Grekas
ae00ff4cfa Merge branch '5.0'
* 5.0: (38 commits)
  [Security] Check UserInterface::getPassword is not null before calling needsRehash
  gracefully handle missing event dispatchers
  Fix TokenStorage::reset not called in stateless firewall
  [DotEnv] Remove `usePutEnv` property default value
  [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists
  Set up typo fix
  [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
  [Cache] fix memory leak when using PhpArrayAdapter
  [Validator] Allow underscore character "_" in URL username and password
  [TwigBridge] Update bootstrap_4_layout.html.twig
  [DoctrineBridge] Removed QueryBuilder type hint in getLoader()
  [FrameworkBundle][SodiumVault] Create secrets directory only when needed
  fix parsing negative octal numbers
  [String] implement __sleep()/__wakeup() on strings
  Fixed translations file dumper behavior
  [Routing][ObjectLoader] Remove forgotten deprecation after merge
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
  [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
  do not validate passwords when the hash is null
  ...
2019-12-07 17:42:39 +01:00
Nicolas Grekas
1d1e29c8cd Merge branch '4.4' into 5.0
* 4.4: (30 commits)
  [Security] Check UserInterface::getPassword is not null before calling needsRehash
  gracefully handle missing event dispatchers
  Fix TokenStorage::reset not called in stateless firewall
  [DotEnv] Remove `usePutEnv` property default value
  [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists
  Set up typo fix
  [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
  [Cache] fix memory leak when using PhpArrayAdapter
  [Validator] Allow underscore character "_" in URL username and password
  [TwigBridge] Update bootstrap_4_layout.html.twig
  [FrameworkBundle][SodiumVault] Create secrets directory only when needed
  fix parsing negative octal numbers
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
  [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
  do not validate passwords when the hash is null
  [DI] fix resolving bindings for named TypedReference
  [Config] never try loading failed classes twice with ClassExistenceResource
  [Mailer] Fix SMTP Authentication when using STARTTLS
  [DI] Fix making the container path-independent when the app is in /app
  ...
2019-12-07 17:40:37 +01:00
Nicolas Grekas
6e44447e5d Merge branch '4.3' into 4.4
* 4.3:
  gracefully handle missing event dispatchers
  [Cache] fix memory leak when using PhpArrayAdapter
  fix parsing negative octal numbers
  [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
  [Config] never try loading failed classes twice with ClassExistenceResource
2019-12-07 17:27:44 +01:00
Nicolas Grekas
a492e72129 Merge branch '3.4' into 4.3
* 3.4:
  [Cache] fix memory leak when using PhpArrayAdapter
  fix parsing negative octal numbers
  [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
  [Config] never try loading failed classes twice with ClassExistenceResource
2019-12-07 17:25:26 +01:00
Fabien Potencier
b4c8d51fed bug #34760 [Mailer] Fix SMTP Authentication when using STARTTLS (DjLeChuck)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix SMTP Authentication when using STARTTLS

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

When the mail server uses STARTTLS, the SMTP Authentication is not performed because the AUTH capabilities are not send during the first EHLO call, but during the second one.

Example of problematic exchange solved by this PR:
```
      < 220 mydomain.tld ESMTP Postcow
      > EHLO [127.0.0.1]
      < 250-mydomain.tld
      < 250-PIPELINING
      < 250-SIZE 104857600
      < 250-ETRN
      < 250-STARTTLS
      < 250-ENHANCEDSTATUSCODES
      < 250-8BITMIME
      < 250-DSN
      < 250 CHUNKING
      > STARTTLS
      < 220 2.0.0 Ready to start TLS
      > EHLO [127.0.0.1]
      < 250-mydomain.tld
      < 250-PIPELINING
      < 250-SIZE 104857600
      < 250-ETRN
      < 250-AUTH PLAIN LOGIN
      < 250-AUTH=PLAIN LOGIN
      < 250-ENHANCEDSTATUSCODES
      < 250-8BITMIME
      < 250-DSN
      < 250 CHUNKING
      > MAIL FROM:<noreply@XXX>
      < 250 2.1.0 Ok
      > RCPT TO:<XXX>
      < 554 5.7.1 <XXX>: Client host rejected: Access denied
```

Commits
-------

75b54542ab [Mailer] Fix SMTP Authentication when using STARTTLS
2019-12-07 15:09:53 +01:00
Fabien Potencier
d84e92c965 feature #34769 [DependencyInjection] Autowire public typed properties (Plopix)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DependencyInjection] Autowire public typed properties

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT

### Description

This PR adds the Autowiring of **public typed properties** in PHP 7.4.
It is only on "public" properties.

It could let people think that services are better injected in "public".
I don't know what to think about it, you?

### How about "private" properties - further thinking

Even if I think that it would be awesome to be able to inject in "private" properties, we discussed it with @nicolas-grekas, and I agree Symfony should not break any standard logic. If the property is private then it is private the DI cannot touch it.

But that could/would remove a lot of boilerplate, and if it is declarative, that might still be something to do.
Maybe we could introduce a new annotation for injection in "private": `@requiredPrivated` ?

Commits
-------

cad7fbb9f7 [DI] Autowire public typed properties
2019-12-07 14:48:36 +01:00
Fabien Potencier
c0b2ade0a3 bug #34762 [Config] never try loading failed classes twice with ClassExistenceResource (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] never try loading failed classes twice with ClassExistenceResource

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

Commits
-------

90c9a80863 [Config] never try loading failed classes twice with ClassExistenceResource
2019-12-07 14:42:18 +01:00
Fabien Potencier
53f2878827 bug #34783 [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass

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

A case we forgot to handle.

Commits
-------

c3574858b5 [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
2019-12-07 14:39:57 +01:00
Fabien Potencier
7dbc4c677b bug #34839 [Cache] fix memory leak when using PhpArrayAdapter (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix memory leak when using PhpArrayAdapter

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

Thanks to @adrienfr, I've been able to understand what causes this massive memory leak when using `PhpArrayAdapter`:
![image](https://user-images.githubusercontent.com/243674/70262187-303b1b00-1794-11ea-9fcb-21ae29c31ff0.png)

When tests run, a new kernel is booted for each test case. This means a new instance of `PhpArrayAdapter` is created, which means it loads its state again and again using `include` for e.g. `annotations.php` in this example.

The first obvious thing is that we see this doing `compile::*`: this means PHP is parsing the same file again and again. But shouldn't opcache prevent this? Well, it's disabled by default because `opcache.enable_cli=0`. To prove the point, here is a comparison with the same tests run with `php -dopcache.enable_cli=1`. The comparison is swapped, but you'll get it:

![image](https://user-images.githubusercontent.com/243674/70262616-fb7b9380-1794-11ea-81c3-6fea0145a63b.png)

But that's not over: because of https://bugs.php.net/76982 (see #32236 also), we still have a memory leak when the included file contains closures. And this one does.

This PR fixes the issue by storing the return value of the include statement into a static property. This fits the caching model of `PhpArrayAdapter`: it's a read-only storage for system caches - i.e. its content is immutable.

Commits
-------

4194c4c56d [Cache] fix memory leak when using PhpArrayAdapter
2019-12-07 14:38:12 +01:00
Fabien Potencier
ed3e111e1d bug #34801 [String] implement __sleep()/__wakeup() on strings (nicolas-grekas)
This PR was merged into the 5.0 branch.

Discussion
----------

[String] implement __sleep()/__wakeup() on strings

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

This resets the transient ignoreCase state on unserialized instances.

Commits
-------

416e40d943 [String] implement __sleep()/__wakeup() on strings
2019-12-07 14:35:22 +01:00
Fabien Potencier
b3f513a9a6 bug #34782 [String] inline Latin-ASCII rules (nicolas-grekas)
This PR was merged into the 5.0 branch.

Discussion
----------

[String] inline Latin-ASCII rules

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

Makes the component a bit more portable.

Commits
-------

976a938736 [String] inline Latin-ASCII rules
2019-12-07 14:33:40 +01:00
Fabien Potencier
8f2cd5bd67 bug #34812 [Yaml] fix parsing negative octal numbers (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] fix parsing negative octal numbers

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

Commits
-------

7ab53f9a39 fix parsing negative octal numbers
2019-12-07 14:29:49 +01:00
Fabien Potencier
9a025b44d9 bug #34854 [Messenger] gracefully handle missing event dispatchers (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] gracefully handle missing event dispatchers

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

Commits
-------

d4ae85fc72 gracefully handle missing event dispatchers
2019-12-07 05:52:32 +01:00
dbrekelmans
8e4cf497cd [Security] Check UserInterface::getPassword is not null before calling needsRehash 2019-12-06 21:36:15 +01:00
Robin Chalas
ae6c5d3482 bug #34788 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34774
| License       | MIT
| Doc PR        | -

`%s` should be escaped, so it is dumped as `%%s` (it ends up being properly unescaped at load time, so the passed value to the service is the same).

Commits
-------

de03cee846 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
2019-12-06 21:35:12 +01:00
Thomas Calvet
31975e4981 [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared 2019-12-06 20:06:44 +01:00
Christian Flothmann
d4ae85fc72 gracefully handle missing event dispatchers 2019-12-06 19:13:02 +01:00
Jérémy Derussé
616c30f185
Fix TokenStorage::reset not called in stateless firewall 2019-12-06 15:46:06 +01:00
Christian Flothmann
de0df4637d mark the Composite constraint as internal 2019-12-06 14:36:16 +01:00
Christian Flothmann
33146778b5 Merge branch '4.3' into 4.4
* 4.3:
  [DotEnv] Remove `usePutEnv` property default value
  Set up typo fix
  [Validator] Allow underscore character "_" in URL username and password
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  do not validate passwords when the hash is null
  [DI] fix resolving bindings for named TypedReference
  [DI] Fix making the container path-independent when the app is in /app
  Allow copy instead of symlink for ./link script
  [FrameworkBundle] resolve service locators in `debug:*` commands
  bumped Symfony version to 4.3.10
  updated VERSION for 4.3.9
  updated CHANGELOG for 4.3.9
  bumped Symfony version to 3.4.37
  updated VERSION for 3.4.36
  update CONTRIBUTORS for 3.4.36
  updated CHANGELOG for 3.4.36
  Add test on ServerLogHandler
2019-12-06 14:32:19 +01:00
Christian Flothmann
2ac56093a5 Merge branch '3.4' into 4.3
* 3.4:
  [Validator] Allow underscore character "_" in URL username and password
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  do not validate passwords when the hash is null
  [DI] Fix making the container path-independent when the app is in /app
  Allow copy instead of symlink for ./link script
  [FrameworkBundle] resolve service locators in `debug:*` commands
  bumped Symfony version to 3.4.37
  updated VERSION for 3.4.36
  update CONTRIBUTORS for 3.4.36
  updated CHANGELOG for 3.4.36
2019-12-06 14:11:20 +01:00
Tugdual Saunier
362c339fa6
[DotEnv] Remove usePutEnv property default value
The value is already set in the constructor (and changes in 5.0) and the class is final.
2019-12-06 12:04:06 +01:00
Nicolas Grekas
3c7b775b3e [Process] change the syntax of portable prepared command lines 2019-12-06 11:06:46 +01:00
Rafael Tovar
b6253e2336 [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists 2019-12-06 10:28:38 +01:00
Alex Bacart
b0daf020de Set up typo fix 2019-12-06 10:25:38 +01:00
Robin Chalas
5807f5f1fb bug #34755 [FrameworkBundle] resolve service locators in debug:* commands (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] resolve service locators in `debug:*` commands

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

Because of the way ServiceClosureArgument are dumped, we need to resolve locators after loading the xml dump of the container:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php#L273

Commits
-------

820da66346 [FrameworkBundle] resolve service locators in `debug:*` commands
2019-12-06 04:55:08 +01:00
Thomas Calvet
c3574858b5 [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass 2019-12-05 23:06:19 +01:00
Nicolas Grekas
4194c4c56d [Cache] fix memory leak when using PhpArrayAdapter 2019-12-05 19:35:35 +01:00
Romain Neutron
869518bc7e
[Validator] Allow underscore character "_" in URL username and password 2019-12-05 15:05:00 +01:00
Fabien Potencier
6b7029b011 bug #34765 [DoctrineBridge] Removed QueryBuilder type hint in getLoader() (HeahDude)
This PR was merged into the 5.0 branch.

Discussion
----------

[DoctrineBridge] Removed QueryBuilder type hint in getLoader()

| Q             | A
| ------------- | ---
| Branch?       | 5.0 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | ~
| License       | MIT
| Doc PR        | ~
<!--
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):
 - 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 master.
-->
Follows #34600.

Commits
-------

8621852396 [DoctrineBridge] Removed QueryBuilder type hint in getLoader()
2019-12-05 07:12:07 +01:00
sabruss
9347b2ea2f [TwigBridge] Update bootstrap_4_layout.html.twig
Missing custom-control-label for custom-switch
2019-12-05 06:58:42 +01:00
Jules Pietri
8621852396 [DoctrineBridge] Removed QueryBuilder type hint in getLoader() 2019-12-04 21:05:45 +01:00
Thomas Calvet
c86157040a [FrameworkBundle][SodiumVault] Create secrets directory only when needed 2019-12-04 18:30:15 +01:00
Christian Flothmann
7ab53f9a39 fix parsing negative octal numbers 2019-12-04 12:33:46 +01:00
Nicolas Grekas
416e40d943 [String] implement __sleep()/__wakeup() on strings 2019-12-04 09:11:16 +01:00
Robin Chalas
bea74560e1 [Security} Make remember-me user providers lazy 2019-12-04 08:39:48 +01:00
Fabien Potencier
302243dd39 bug #34776 [DI] fix resolving bindings for named TypedReference (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix resolving bindings for named TypedReference

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

As spotted in https://github.com/symfony/symfony/pull/34769#issuecomment-561064156

Commits
-------

62c227e368 [DI] fix resolving bindings for named TypedReference
2019-12-04 07:44:27 +01:00
Fabien Potencier
7f567584a5 bug #34794 [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34752
| License       | MIT
| Doc PR        | -

One more case we forgot 😅

Commits
-------

b6c5a54cfd [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
2019-12-04 07:43:26 +01:00
Fabien Potencier
98694d8677 bug #34795 [Routing][ObjectLoader] Remove forgotten deprecation after merge (fancyweb)
This PR was merged into the 5.0 branch.

Discussion
----------

[Routing][ObjectLoader] Remove forgotten deprecation after merge

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

https://github.com/symfony/symfony/pull/34621 needs to be gone on 5.0. We want to throw here. I think it was forgotten when merging in 5.0.

Commits
-------

4e60b9db22 [Routing][ObjectLoader] Remove forgotten deprecation after merge
2019-12-04 07:40:02 +01:00
Fabien Potencier
fb08d9c101 Merge branch '4.4' into 5.0
* 4.4:
  Fixed translations file dumper behavior
  When set, get secret from config variable
  [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
  [SecurityBundle] Fix switch_user provider configuration handling
2019-12-04 07:31:37 +01:00
Yonel Ceruto
1c41ae7631 Fixed translations file dumper behavior 2019-12-03 23:35:13 -05:00
Thomas Calvet
4e60b9db22 [Routing][ObjectLoader] Remove forgotten deprecation after merge 2019-12-03 23:29:20 +01:00
Jeroen van den Nieuwenhuisen
83a5517c01 [SecurityBundle] Passwords are not encoded when algorithm set to \"true\" 2019-12-03 22:04:52 +01:00
Robin Chalas
e1f7b7886e bug #34759 [SecurityBundle] Fix switch_user provider configuration handling (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Fix switch_user provider configuration handling

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

The default provider here can be null if there are multiple configured providers configured + the firewall doesn't define its provider at the root level + it is anonymous, ie:
```yaml
providers:
    my_provider:
        # ...
    monitor_provider:
        # ...
firewalls:
    main:
        switch_user:
            provider: my_provider
        anonymous: true
        # ...
```

Commits
-------

417169b745 [SecurityBundle] Fix switch_user provider configuration handling
2019-12-03 21:51:34 +01:00
Thomas Calvet
b6c5a54cfd [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass 2019-12-03 21:47:51 +01:00
Robin Chalas
120f32c3c4 bug #34786 [SecurityBundle] Use config variable in AnonymousFactory (martijnboers)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Use config variable in AnonymousFactory

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

It looks like the `AnonymousFactory` was copied incorrectly in https://github.com/symfony/symfony/pull/33503 as it uses the old `$firewall` variable available in `SecurityExtension.php`. Changing this to `$config` yields the desired results

Commits
-------

8d850d2da4 When set, get secret from config variable
2019-12-03 21:44:39 +01:00
Robin Chalas
c01a583b75 bug #34784 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/34526, Closes #34767
| License       | MIT
| Doc PR        | -

Alternative to https://github.com/symfony/symfony/pull/34767, idea by @nicolas-grekas.

Commits
-------

e8d3c2b969 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
2019-12-03 21:41:27 +01:00
Thomas Calvet
de03cee846 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass 2019-12-03 19:26:40 +01:00
Christian Flothmann
5699cb22bb do not validate passwords when the hash is null 2019-12-03 19:05:24 +01:00
Martijn Boers
8d850d2da4
When set, get secret from config variable
This was incorrectly copied in PR

https://github.com/symfony/symfony/pull/33503
2019-12-03 17:45:30 +01:00
Nicolas Grekas
c732122b57 Merge branch '5.0'
* 5.0:
  [Security/Core] Fix checking for SHA256/SHA512 passwords
  [Cache][Lock] fix tests
  bumped Symfony version to 5.0.2
  updated VERSION for 5.0.1
  updated CHANGELOG for 5.0.1
  bumped Symfony version to 4.4.2
  updated VERSION for 4.4.1
  updated CHANGELOG for 4.4.1
2019-12-03 17:36:15 +01:00
Nicolas Grekas
9dbeab93f2 Merge branch '4.4' into 5.0
* 4.4:
  [Security/Core] Fix checking for SHA256/SHA512 passwords
  [Cache][Lock] fix tests
  bumped Symfony version to 4.4.2
  updated VERSION for 4.4.1
  updated CHANGELOG for 4.4.1
2019-12-03 17:35:18 +01:00
Nicolas Grekas
6611ae654b minor #34721 [MonologBridge] Add test on ServerLogHandler (jderusse)
This PR was merged into the 4.3 branch.

Discussion
----------

[MonologBridge] Add test on ServerLogHandler

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

After writing https://github.com/symfony/symfony/pull/34697#issuecomment-559840469 I realized that  ServerLogHandler wasn't tested.

Tell me if it's a BugFix and should be rebased on 4.3

Commits
-------

8c7947f827 Add test on ServerLogHandler
2019-12-03 17:28:04 +01:00
Nicolas Grekas
1f0070521c minor #34778 [Cache][Lock] fix tests (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][Lock] fix tests

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

Commits
-------

5845c3f8cd [Cache][Lock] fix tests
2019-12-03 17:13:30 +01:00
Nicolas Grekas
976a938736 [String] inline Latin-ASCII rules 2019-12-03 16:53:46 +01:00
David Brooks
799c85b67c [Security/Core] Fix checking for SHA256/SHA512 passwords 2019-12-03 15:57:37 +01:00
Thomas Calvet
e8d3c2b969 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand 2019-12-03 14:44:43 +01:00
Nicolas Grekas
5845c3f8cd [Cache][Lock] fix tests 2019-12-03 11:28:45 +01:00
Nicolas Grekas
62c227e368 [DI] fix resolving bindings for named TypedReference 2019-12-03 10:36:50 +01:00
Morel Sébastien
cad7fbb9f7
[DI] Autowire public typed properties 2019-12-03 01:03:38 -08:00
Fabien Potencier
6c163906f2 feature #34771 Deprecate *Response::create() methods (fabpot)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Deprecate *Response::create() methods

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a<!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

The `::create()` methods of the `Response` class hierarchy are not needed anymore in modern PHP versions as we can use parenthesis around the new operator. So `Response::create()->...()` is equivalent to `(new Response)->...()`.

Let's deprecate the static method. It's also good as the first parameter type changes depending on the sub-class.

Commits
-------

ebb13e7c99 Deprecate *Response::create() methods
2019-12-03 09:14:46 +01:00
Javier Eguiluz
138200cd88 [Form] Allow to translate each language into its language in LanguageType 2019-12-03 09:12:30 +01:00
Nicolas Grekas
90c9a80863 [Config] never try loading failed classes twice with ClassExistenceResource 2019-12-03 08:51:16 +01:00
Fabien Potencier
ebb13e7c99 Deprecate *Response::create() methods 2019-12-03 07:30:08 +01:00
Thomas Calvet
417169b745 [SecurityBundle] Fix switch_user provider configuration handling 2019-12-02 17:24:17 +01:00
Vivien
75b54542ab [Mailer] Fix SMTP Authentication when using STARTTLS 2019-12-02 17:18:01 +01:00
Nicolas Grekas
b33b9a6ad9 [DI] Fix making the container path-independent when the app is in /app 2019-12-02 16:26:29 +01:00
Nicolas Grekas
820da66346 [FrameworkBundle] resolve service locators in debug:* commands 2019-12-02 14:28:43 +01:00
Fabien Potencier
08a8e77991 bumped Symfony version to 5.0.2 2019-12-01 15:15:07 +01:00
Fabien Potencier
ffd6087323 updated VERSION for 5.0.1 2019-12-01 15:11:30 +01:00
Fabien Potencier
f75e9d583c bumped Symfony version to 4.4.2 2019-12-01 15:09:53 +01:00
Fabien Potencier
5009b8a838 updated VERSION for 4.4.1 2019-12-01 15:06:38 +01:00
Fabien Potencier
e9366b4d17 bumped Symfony version to 4.3.10 2019-12-01 15:05:41 +01:00
Fabien Potencier
7ac4f9062d updated VERSION for 4.3.9 2019-12-01 15:00:23 +01:00
Fabien Potencier
7a13ea3efb bumped Symfony version to 3.4.37 2019-12-01 14:59:33 +01:00
Fabien Potencier
ae2514cd03 updated VERSION for 3.4.36 2019-12-01 14:50:37 +01:00
Nicolas Grekas
e0f6cdb1c7 Merge branch '5.0'
* 5.0:
  [HttpClient] Fix deps
  Fix tests
2019-12-01 12:19:04 +01:00
Nicolas Grekas
a266b35bbd [HttpClient] Fix deps 2019-12-01 12:18:54 +01:00
Nicolas Grekas
af81b8bbb7 Fix tests 2019-12-01 12:14:36 +01:00
Nicolas Grekas
861fb4b520 Merge branch '5.0'
* 5.0:
  Fix failures on PHP 7.4
  Fix tests
  [Console] fix typos
  [Console] fix tests
2019-12-01 11:51:31 +01:00
Nicolas Grekas
572117a660 Merge branch '4.4' into 5.0
* 4.4:
  Fix failures on PHP 7.4
  Fix tests
  [Console] fix typos
  [Console] fix tests
2019-12-01 11:51:15 +01:00
Nicolas Grekas
febff9b1fd Merge branch '4.3' into 4.4
* 4.3:
  Fix failures on PHP 7.4
2019-12-01 11:50:45 +01:00
Nicolas Grekas
54e2ad7c88 Merge branch '3.4' into 4.3
* 3.4:
  Fix failures on PHP 7.4
2019-12-01 11:50:31 +01:00
Nicolas Grekas
a94e76a866 Fix failures on PHP 7.4 2019-12-01 11:45:41 +01:00
Nicolas Grekas
9ad38b2e5f Fix tests 2019-12-01 11:19:36 +01:00
Nicolas Grekas
c22b36ef50 Merge branch '4.3' into 4.4
* 4.3:
  [Console] fix typos
  [Console] fix tests
2019-12-01 11:06:17 +01:00
Nicolas Grekas
a489c529ef Merge branch '3.4' into 4.3
* 3.4:
  [Console] fix typos
2019-12-01 11:04:59 +01:00
Nicolas Grekas
abc2880be4 [Console] fix typos 2019-12-01 11:04:45 +01:00
Nicolas Grekas
cd2a8d2628 [Console] fix tests 2019-12-01 10:59:54 +01:00
Fabien Potencier
324272111c Merge branch '5.0'
* 5.0:
  Add missing use statement
  [Notifier] Add telegram tests
  [Notifier] Add Slack bridge tests
2019-12-01 10:14:14 +01:00
Fabien Potencier
32b5d07139 Merge branch '4.4' into 5.0
* 4.4:
  Add missing use statement
2019-12-01 10:14:07 +01:00
Fabien Potencier
f3a670fb4a Add missing use statement 2019-12-01 10:13:30 +01:00
Fabien Potencier
c147ef4bc7 Merge branch '4.4'
* 4.4:
  Fix CS
  Fix CS
  Fix CS
  [DependencyInjection][Xml] Fix the attribute 'tag' is not allowed in 'bind' tag
2019-12-01 09:49:37 +01:00
Fabien Potencier
c13974cc20 Merge branch '4.4' into 5.0
* 4.4:
  Fix CS
  Fix CS
  Fix CS
  [DependencyInjection][Xml] Fix the attribute 'tag' is not allowed in 'bind' tag
2019-12-01 09:48:26 +01:00
Fabien Potencier
23e5d1aa8e Fix CS 2019-12-01 09:46:01 +01:00
Fabien Potencier
9b10c167ef Merge branch '4.3' into 4.4
* 4.3:
  Fix CS
  Fix CS
2019-12-01 09:39:58 +01:00
Fabien Potencier
2c04fad016 Fix CS 2019-12-01 09:39:44 +01:00
Fabien Potencier
d5ca9ec2c7 Merge branch '3.4' into 4.3
* 3.4:
  Fix CS
2019-12-01 09:34:52 +01:00
Fabien Potencier
861783cc15 Fix CS 2019-12-01 09:33:36 +01:00
Fabien Potencier
a6527464e7 minor #34539 [Notifier] Add telegram tests (Jeroeny)
This PR was squashed before being merged into the 5.0 branch (closes #34539).

Discussion
----------

[Notifier] Add telegram tests

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | See #33687
| License       | MIT

Adds tests for the Telegram bridge of the Notifier component. Not sure if this is the right way to go, but would love some feedback.

#SymfonyHackday

Commits
-------

3b4d83cb4a [Notifier] Add telegram tests
2019-11-30 19:15:43 +01:00
Jeroeny
3b4d83cb4a [Notifier] Add telegram tests 2019-11-30 19:15:37 +01:00
Fabien Potencier
0be4647bd9 minor #34549 [Notifier] Add Slack bridge tests (Jeroeny)
This PR was squashed before being merged into the 5.0 branch (closes #34549).

Discussion
----------

[Notifier] Add Slack bridge tests

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | See #33687
| License       | MIT

Adds tests for the Slack bridge of the Notifier component.

#SymfonyHackday

Commits
-------

626fdaa9a4 [Notifier] Add Slack bridge tests
2019-11-30 19:14:26 +01:00
Jeroeny
626fdaa9a4 [Notifier] Add Slack bridge tests 2019-11-30 19:14:20 +01:00
tien.xuan.vo
e38f7d41ef [DependencyInjection][Xml] Fix the attribute 'tag' is not allowed in 'bind' tag 2019-11-30 23:34:06 +07:00
Jérémy Derussé
8c7947f827
Add test on ServerLogHandler 2019-11-30 17:13:10 +01:00
Nicolas Grekas
c62bb82e27 Merge branch '5.0'
* 5.0:
  [DI] auto-register singly implemented interfaces by default
  [DI] fix overriding existing services with aliases for singly-implemented interfaces
  remove service when base class is missing
  do not depend on the QueryBuilder from the ORM
  [Security/Http] call auth listeners/guards eagerly when they "support" the request
  [Messenger] add tests to FailedMessagesShowCommand
  Fix the translation commands when a template contains a syntax error
  [Security] Fix clearing remember-me cookie after deauthentication
  [Validator] Update Slovenian translations
  [HttpClient] remove conflict rule with HttpKernel that prevents using the component in Symfony 3.4
  [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
  Fix compatibility with Monolog 2
  fix dumping number-like string parameters
  Fix CI
  [Console] Fix autocomplete multibyte input support
  [Config] don't break on virtual stack frames in ClassExistenceResource
  more robust initialization from request
  Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
2019-11-30 15:13:05 +01:00
Nicolas Grekas
bb11cac33e Merge branch '4.4' into 5.0
* 4.4:
  [DI] auto-register singly implemented interfaces by default
  [DI] fix overriding existing services with aliases for singly-implemented interfaces
  remove service when base class is missing
  do not depend on the QueryBuilder from the ORM
  [Security/Http] call auth listeners/guards eagerly when they "support" the request
  [Messenger] add tests to FailedMessagesShowCommand
  Fix the translation commands when a template contains a syntax error
  [Security] Fix clearing remember-me cookie after deauthentication
  [Validator] Update Slovenian translations
  [HttpClient] remove conflict rule with HttpKernel that prevents using the component in Symfony 3.4
  [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
  fix dumping number-like string parameters
  Fix CI
  [Console] Fix autocomplete multibyte input support
  [Config] don't break on virtual stack frames in ClassExistenceResource
  more robust initialization from request
  Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
2019-11-30 15:12:50 +01:00
Nicolas Grekas
9b658ed4a2 bug #34729 [DI] auto-register singly implemented interfaces by default (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] auto-register singly implemented interfaces by default

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

Commits
-------

209b330fd6 [DI] auto-register singly implemented interfaces by default
2019-11-30 15:05:16 +01:00
Nicolas Grekas
c222aaae70 bug #34728 [DI] fix overriding existing services with aliases for singly-implemented interfaces (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix overriding existing services with aliases for singly-implemented interfaces

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

Commits
-------

739357656d [DI] fix overriding existing services with aliases for singly-implemented interfaces
2019-11-30 15:04:25 +01:00
Nicolas Grekas
df379f0d07 Merge branch '4.3' into 4.4
* 4.3:
  [Messenger] add tests to FailedMessagesShowCommand
  Fix the translation commands when a template contains a syntax error
  [Security] Fix clearing remember-me cookie after deauthentication
  [Validator] Update Slovenian translations
  [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
  fix dumping number-like string parameters
  Fix CI
  [Console] Fix autocomplete multibyte input support
  [Config] don't break on virtual stack frames in ClassExistenceResource
  more robust initialization from request
2019-11-30 15:03:57 +01:00
Nicolas Grekas
cad14177dc Merge branch '3.4' into 4.3
* 3.4:
  [Security] Fix clearing remember-me cookie after deauthentication
  more robust initialization from request
2019-11-30 14:16:45 +01:00
LIBERT Jérémy
d6ccd4c40f Added MimeType for ".msg" 2019-11-30 14:04:25 +01:00
Fabien Potencier
9b3cc04522 bug #34649 more robust initialization from request (dbu)
This PR was merged into the 3.4 branch.

Discussion
----------

more robust initialization from request

Request::getPort is declared as int|string but can actually return null.

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

I discovered this problem with a functional test where i dispatch the RequestEvent with a `new Request()`. This used to work in symfony 4 and now triggers an error `Argument 1 passed to Symfony\Component\Routing\RequestContext::setHttpPort() must be of the type int, null given`

In regular web requests, this should probably never happen, but it seems to me if Request is not robust, the RequestContext should be robust about it.

Commits
-------

c6ed0f0208 more robust initialization from request
2019-11-30 13:57:32 +01:00
Nicolas Grekas
209b330fd6 [DI] auto-register singly implemented interfaces by default 2019-11-30 13:50:03 +01:00
Fabien Potencier
b357488e77 bug #34715 [TwigBundle] remove service when base class is missing (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBundle] remove service when base class is missing

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

Commits
-------

c3a658ac0f remove service when base class is missing
2019-11-30 13:44:40 +01:00
Nicolas Grekas
739357656d [DI] fix overriding existing services with aliases for singly-implemented interfaces 2019-11-30 13:15:17 +01:00
Christian Flothmann
c3a658ac0f remove service when base class is missing 2019-11-30 11:12:23 +01:00
Christian Flothmann
6958d77f0c do not depend on the QueryBuilder from the ORM 2019-11-30 11:00:03 +01:00
Fabien Potencier
4d11bca474 bug #34627 [Security/Http] call auth listeners/guards eagerly when they "support" the request (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Http] call auth listeners/guards eagerly when they "support" the request

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

This fixes the form authenticator linked to #34614.
Since laziness is here to provide compatibility with HTTP caching, it should be disabled when the request cannot be cached.

Tests don't pass yet, but I'm on the path to something here.

The PR now introduces a new `AbstractListener` that splits the handling logic in two:
- `supports(Request): ?bool` is always called eagerly and tells whether the listener matches the request for an earger call or a lazy call
- `authenticate(RequestEvent)` does the rest of the job when `supports()` allows so - lazily or not depending on the return value of `supports()`.

Of course, this remains compatible with non-lazy logics, see `AbstractListener::__invoke()`.

Commits
-------

b20ebe6b90 [Security/Http] call auth listeners/guards eagerly when they "support" the request
2019-11-30 10:56:08 +01:00
Nicolas Grekas
b20ebe6b90 [Security/Http] call auth listeners/guards eagerly when they "support" the request 2019-11-30 10:49:41 +01:00
Fabien Potencier
d2a5c057c5 bug #34671 [Security] Fix clearing remember-me cookie after deauthentication (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Fix clearing remember-me cookie after deauthentication

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

If you are using the `remember_me` listener and the refreshed user is deauthenticated, you are still logged in because the remember-me cookie does not get cleared.
This fixes it.

Commits
-------

d625a73705 [Security] Fix clearing remember-me cookie after deauthentication
2019-11-30 09:47:34 +01:00
Fabien Potencier
04d6d8dc56 feature #34648 [Mailer] Allow to configure or disable the message bus to use (ogizanagi)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Mailer] Allow to configure or disable the message bus to use

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | #34633 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | todo

A new `mailer.message_bus` option allowing to choose the message bus to use instead of using the default one.
Also allows to set it to `false` so no message bus is used and the transport will be called directly.

Commits
-------

42fd0cf985 [Mailer] Allow to configure or disable the message bus to use
2019-11-30 09:35:18 +01:00
Fabien Potencier
270247aa74 feature #34705 [Validator] Label regex in date validator (kristofvc)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Validator] Label regex in date validator

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

This change makes sure that when extending the DateValidator you can easily change the format withouth changing anything else.
eg. you can change the pattern to
`/^(?<day>\d{2})/(?<month>\d{2})/(?<year>\d{4})$/` but the implementation still checks your date correctly.

Commits
-------

ec09f7e630 Label regex in date validator
2019-11-30 09:31:28 +01:00
Fabien Potencier
2a9c31e6cf Merge branch '3.4' into 4.3
* 3.4:
  Fix the translation commands when a template contains a syntax error
  [Validator] Update Slovenian translations
2019-11-30 09:28:34 +01:00
Fabien Potencier
7a7ddc04c8 bug #34711 Fix the translation commands when a template contains a syntax error (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix the translation commands when a template contains a syntax error

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #34586
| License       | MIT
| Doc PR        | n/a

When using `debug:translation` or `translation:update`, we should catch exceptions to avoid breaking the command. It was not really an issue before Symfony 4.4/5 as we didn't have templates in the core that use features from optional dependencies.

Commits
-------

7f803bc674 Fix the translation commands when a template contains a syntax error
2019-11-30 09:28:01 +01:00
Fabien Potencier
6cc2c293bc bug #34032 [Mime] Fixing multidimensional array structure with FormDataPart (jvahldick)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Fixing multidimensional array structure with FormDataPart

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

The issue is pretty much described on #34031
The current structure of the raw body build on FormDataPart is not well recognized by the server. It considers all the fields as a root type, when actually it is possible to send arrays by html forms.

Lets the following structure on the html
```html
<input type="text" name="names[]" value="John" />
<input type="text" name="names[]" value="Doe" />
```

It creates the following raw body:
```
----------------------------466490401959219490193856
Content-Disposition: form-data; name="names[]"

John
----------------------------466490401959219490193856
Content-Disposition: form-data; name="names[]"

Doe
----------------------------466490401959219490193856--
```

Meanwhile, the FormDataPart on Mime component generates the following body:
```
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data

John
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_
Content-Type: text/plain; charset=utf-8; name=1
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name=1

Doe
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_--
```

For more complex structures, the $_POST doesn't even recognize properly the field names and values.

Commits
-------

ca630e5351 Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
2019-11-30 09:27:26 +01:00
Fabien Potencier
1d03e0e1a8 minor #34641 [Messenger] add tests to FailedMessagesShowCommand (ahmedash95)
This PR was squashed before being merged into the 4.3 branch (closes #34641).

Discussion
----------

[Messenger] add tests to FailedMessagesShowCommand

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

Add missing tests to FailedMessagesShowCommand in Messenger component

Commits
-------

4b9b93f5d6 [Messenger] add tests to FailedMessagesShowCommand
2019-11-30 09:26:46 +01:00
Ahmed
4b9b93f5d6 [Messenger] add tests to FailedMessagesShowCommand 2019-11-30 09:26:41 +01:00
Fabien Potencier
7f803bc674 Fix the translation commands when a template contains a syntax error 2019-11-30 09:19:08 +01:00
Robin Chalas
d625a73705 [Security] Fix clearing remember-me cookie after deauthentication 2019-11-30 02:46:11 +01:00
Kristof Van Cauwenbergh
ec09f7e630 Label regex in date validator 2019-11-29 21:04:48 +01:00
Peter Kokot
b2ae60a73b [Validator] Update Slovenian translations 2019-11-29 20:07:18 +01:00
Nicolas Grekas
73ea89b4c2 Merge branch '3.4' into 4.3
* 3.4:
  [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
  fix dumping number-like string parameters
  [Console] Fix autocomplete multibyte input support
  [Config] don't break on virtual stack frames in ClassExistenceResource
2019-11-29 18:37:27 +01:00
Nicolas Grekas
d9c6476407 [HttpClient] remove conflict rule with HttpKernel that prevents using the component in Symfony 3.4 2019-11-29 17:55:58 +01:00
Nicolas Grekas
9eafff5ec0 bug #34560 [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34053
| License       | MIT
| Doc PR        | -

Basically we can fix this bug by "reimplementing" php src way of building the __toString() of the method except that we avoid to call the undefined constant. Obviously we cannot invalidate the resource if the value of the constant changes since we never knew it. However, it's still better than now.

Commits
-------

8de2a226a8 [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
2019-11-29 17:06:11 +01:00
Thomas Calvet
8de2a226a8 [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values 2019-11-29 17:04:16 +01:00
Nicolas Grekas
2d2dd6244c bug #34695 [Config] don't break on virtual stack frames in ClassExistenceResource (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] don't break on virtual stack frames in ClassExistenceResource

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

Commits
-------

fffeccd744 [Config] don't break on virtual stack frames in ClassExistenceResource
2019-11-29 17:02:06 +01:00
Jérémy Derussé
bdb10f7cd5
Fix compatibility with Monolog 2 2019-11-29 17:01:06 +01:00
Christian Flothmann
e0851737ab bug #34716 [DependencyInjection] fix dumping number-like string parameters (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] fix dumping number-like string parameters

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

Commits
-------

a1ce0ed086 fix dumping number-like string parameters
2019-11-29 16:39:50 +01:00
Grégoire Pineau
0a91f9baa1 feature #34591 [Workflow] Added Registry::has() to check if a workflow exists (lyrixx)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Workflow] Added `Registry::has()` to check if a workflow exists

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

---

Allow to use
```php
$registry->has($subject);
// or
$registry->has($subject, 'workflow_a')
```

Commits
-------

8a4f03dee8 [Workflow] Added `Registry::has()` to check if a workflow exists
2019-11-29 16:39:47 +01:00
Christian Flothmann
a1ce0ed086 fix dumping number-like string parameters 2019-11-29 16:28:12 +01:00
Jan Schädlich
2640dfedfa [Yaml] Introduce yaml-lint binary 2019-11-29 10:38:36 +01:00
Thomas Calvet
a1129f938c [Console] Fix autocomplete multibyte input support 2019-11-29 10:09:40 +01:00
Nicolas Grekas
fffeccd744 [Config] don't break on virtual stack frames in ClassExistenceResource 2019-11-28 16:42:08 +01:00
Nicolas Grekas
746614807a Merge branch '5.0'
* 5.0:
  Fix merge
2019-11-28 15:32:46 +01:00
Nicolas Grekas
7c7d98135a Fix merge 2019-11-28 15:32:28 +01:00
Nicolas Grekas
d7cc01cd76 Merge branch '5.0'
* 5.0: (30 commits)
  bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
  Fix tests
  [Console] Fix commands description with numeric namespaces
  [HttpFoundation] Fixed typo
  [DI] Skip unknown method calls for factories in check types pass
  [EventDispatcher] Better error reporting when arguments to dispatch() are swapped
  [errorHandler] Remove old references from the old debug component
  improve upgrade instructions for twig.exception_controller configuration
  [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
  [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
  [Form] Keep preferred_choices order for choice groups
  [Debug] work around failing chdir() on Darwin
  [PhpUnitBridge] Read configuration CLI directive
  [DI] Missing test on YamlFileLoader
  Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)"
  Simpler example for Apache basic auth workaround
  [Console] Fix trying to access array offset on value of type int
  [Config] Remove extra sprintf arg
  [HttpKernel] fix typo
  [HttpKernel] Support typehint to deprecated FlattenException in controller
  ...
2019-11-28 15:26:02 +01:00
Nicolas Grekas
3aa2a770b8 Merge branch '4.4' into 5.0
* 4.4: (28 commits)
  bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
  Fix tests
  [Console] Fix commands description with numeric namespaces
  [HttpFoundation] Fixed typo
  [DI] Skip unknown method calls for factories in check types pass
  [EventDispatcher] Better error reporting when arguments to dispatch() are swapped
  improve upgrade instructions for twig.exception_controller configuration
  [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
  [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
  [Form] Keep preferred_choices order for choice groups
  [Debug] work around failing chdir() on Darwin
  [PhpUnitBridge] Read configuration CLI directive
  [DI] Missing test on YamlFileLoader
  Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)"
  Simpler example for Apache basic auth workaround
  [Console] Fix trying to access array offset on value of type int
  [Config] Remove extra sprintf arg
  [HttpKernel] fix typo
  [HttpKernel] Support typehint to deprecated FlattenException in controller
  Add preview mode support for Html and Serializer error renderers
  ...
2019-11-28 15:20:16 +01:00
Nicolas Grekas
475967cbc1 Merge branch '4.3' into 4.4
* 4.3:
  bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
2019-11-28 15:12:27 +01:00
Nicolas Grekas
53127c54a1 bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix early cleanup of pushed HTTP/2 responses

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

Commits
-------

0f51da6ec7 [HttpClient] Fix early cleanup of pushed HTTP/2 responses
2019-11-28 15:09:27 +01:00
Nicolas Grekas
3e917dbfe3 Merge branch '4.3' into 4.4
* 4.3:
  Fix tests
  [Console] Fix commands description with numeric namespaces
  [HttpFoundation] Fixed typo
  [EventDispatcher] Better error reporting when arguments to dispatch() are swapped
  [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
  [Form] Keep preferred_choices order for choice groups
  [Debug] work around failing chdir() on Darwin
  [PhpUnitBridge] Read configuration CLI directive
  [DI] Missing test on YamlFileLoader
  Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)"
  Simpler example for Apache basic auth workaround
  [Console] Fix trying to access array offset on value of type int
  [Config] Remove extra sprintf arg
  [VarDumper] notice on potential undefined index
  [HttpClient] turn exception into log when the request has no content-type
  [Process] add tests for php executable finder if file does not exist
  [Cache] Make sure we get the correct number of values from redis::mget()
  [TwigBridge] Add row_attr to all form themes
  [Serializer] Fix MetadataAwareNameConverter usage with string group
2019-11-28 14:33:56 +01:00
Nicolas Grekas
845943ab10 Merge branch '3.4' into 4.3
* 3.4:
  [Console] Fix commands description with numeric namespaces
  [HttpFoundation] Fixed typo
2019-11-28 14:29:27 +01:00
Nicolas Grekas
fa783f9697 bug #34130 [Console] Fix commands description with numeric namespaces (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fix commands description with numeric namespaces

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34111
| License       | MIT
| Doc PR        | -

This PR fixes the linked ticket case.

It also changes the keys sorting to display the numeric namespaces first.

It also fixes another bug if your command name starts with `_global:`. In this special case the command is considered global but its full name is still `_global:xxx`. We can't do better without more refactoring since the final array of namespaces and global commands is shared, `_global` just being a special key. Currently, if your command starts with `_global`, all global commands are not displayed at all so it's better like this anyway.

It also fixes another bug if your command starts with `0:` (cf `'' ===` comparison).

Commits
-------

4d47868125 [Console] Fix commands description with numeric namespaces
2019-11-28 14:28:57 +01:00
Nicolas Grekas
51045927da Fix tests 2019-11-28 14:25:45 +01:00
Thomas Calvet
4d47868125 [Console] Fix commands description with numeric namespaces 2019-11-28 14:20:50 +01:00
Thomas Bisignani
3378890e70 [HttpFoundation] Fixed typo 2019-11-28 13:52:59 +01:00
Nicolas Grekas
8378d958e2 bug #34562 [DI] Skip unknown method calls for factories in check types pass (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Skip unknown method calls for factories in check types pass

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34559
| License       | MIT
| Doc PR        | -

Ref https://github.com/symfony/symfony/issues/30885 and https://github.com/symfony/symfony/pull/30889.

Commits
-------

592bff88f2 [DI] Skip unknown method calls for factories in check types pass
2019-11-28 13:12:35 +01:00
Thomas Calvet
592bff88f2 [DI] Skip unknown method calls for factories in check types pass 2019-11-28 13:12:16 +01:00
Nicolas Grekas
28c3b3e3e7 bug #34677 [EventDispatcher] Better error reporting when arguments to dispatch() are swapped (rimas-kudelis)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] Better error reporting when arguments to dispatch() are swapped

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34676
| License       | MIT

Incorrect error is currently being reported when the second argument is an instance of `Symfony\Contracts\EventDispatcher\Event`.

Commits
-------

54aac56ab8 [EventDispatcher] Better error reporting when arguments to dispatch() are swapped
2019-11-28 12:54:58 +01:00
Rimas Kudelis
54aac56ab8 [EventDispatcher] Better error reporting when arguments to dispatch() are swapped 2019-11-28 12:54:51 +01:00
Vincent
326df983ca [errorHandler] Remove old references from the old debug component 2019-11-28 12:50:50 +01:00
Nicolas Grekas
8d22819443 minor #34582 [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4 (tseho)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4

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

As explained in https://github.com/symfony/symfony/issues/34491, there was a BC BREAK between 4.3 and 4.4, when using `PdoSessionHandler` with MySQL, where the column `sess_lifetime` was modified from `MEDIUMINT` to `INTEGER UNSIGNED`.

This PR updates `UPGRADE-4.4.md` with a suggested query for updating the database accordingly.

Commits
-------

eda4d68f7d [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
2019-11-28 12:41:55 +01:00