Commit Graph

44232 Commits

Author SHA1 Message Date
Fabien Potencier
5e9fa9d75e Fix typo 2019-12-19 10:48:27 +01:00
Nicolas Grekas
b38aad5a39 bug #35022 [Dotenv] FIX missing getenv (mccullagh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] FIX missing getenv

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

Revert one line to use getenv because not all environment variables are populated in $_ENV[]

Commits
-------

9c5754acaa [Dotenv] FIX missing getenv
2019-12-18 22:43:02 +01:00
Nicolas Grekas
4d064a2584 bug #35025 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient][Psr18Client] Remove Psr18ExceptionTrait

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

Interesting case. Declared trait are instantly loaded by PHP. When ClassExistenceResource fails to load this class because of a thrown \LogicException (when a dependency is missing, cf the top of this class) the trait is loaded. Then, to display the exception, this class is reaccessed (I guess by the duplicated request 🤔) and it results in a fatal error "Cannot redeclare trait...". Basically ClassExistenceResource does not support this kind of structure (thrown exception + trait). Let's do the easy fix first, and then revert if someone finds a fix for the root problem?

Commits
-------

c1746d8b14 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait
2019-12-18 22:38:12 +01:00
Alexander McCullagh
9c5754acaa [Dotenv] FIX missing getenv 2019-12-18 16:41:13 +01:00
Thomas Calvet
c1746d8b14 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait 2019-12-18 16:09:34 +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
Nicolas Grekas
b47f1af6c2 minor #35020 [HttpFoundation] use utf8mb4_bin to align code with documentation (bendavies)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] use utf8mb4_bin to align code with documentation

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

This aligns the code with [the documentation](https://symfony.com/doc/3.4/doctrine/pdo_session_storage.html#mysql), which says to use `utf8mb4` for the character set when using mysql.

Commits
-------

3739ec9f29 use utf8mb4_bin to align code with documentation
2019-12-18 13:05:47 +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
2b0f9d6bd9 [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig 2019-12-17 13:15:16 +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
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
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
624f2e345b bug #34996 Fix displaying anonymous classes on PHP 7.4 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix displaying anonymous classes on PHP 7.4

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

Follows 0f2cdbf214 (diff-3a8139128d4026ce0cb0c86beba4e6b9R6351)

Commits
-------

c36568a1ed Fix displaying anonymous classes on PHP 7.4
2019-12-16 15:24:15 +01:00
Nicolas Grekas
c36568a1ed Fix displaying anonymous classes on PHP 7.4 2019-12-16 15:20:08 +01:00
Nicolas Grekas
b729b5c814 Skip deprecations from doctrine/orm 2019-12-16 14:25:15 +01:00
Nicolas Grekas
6c32cc686e Merge branch '3.4' into 4.3
* 3.4:
  Ignore deprecations about doctrine/persistence coming from doctrine/orm
2019-12-16 13:42:19 +01:00
Nicolas Grekas
9d0a705981 Ignore deprecations about doctrine/persistence coming from doctrine/orm 2019-12-16 13:38:17 +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
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
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
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
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
fd5fcfe654 minor #34978 [Cache] Fix wrong classname in deprecation message (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] Fix wrong classname in deprecation message

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

Actually the deprecation message points to classes that doesn't exists do to missing use statements

before:
```
The "Symfony\Component\Cache\Simple\ApcuCache" class is deprecated since Symfony 4.3, use "Symfony\Component\Cache\Simple\ApcuAdapter" and type-hint for "Symfony\Component\Cache\Simple\CacheInterface" instead.'
```

after:
```
The "Symfony\Component\Cache\Simple\ApcuCache" class is deprecated since Symfony 4.3, use "Symfony\Component\Cache\Adapter\ApcuAdapter" and type-hint for "Symfony\Contracts\Cache\CacheInterface" instead.'
```

Commits
-------

c7115a3087 [Cache] Fix wrong classname in deprecation message
2019-12-15 10:54:23 +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
Yonel Ceruto
12ff0bceaf minor #34975 [Messenger] Fixed syntax in comment (Nyholm)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fixed syntax in comment

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

Super minor

Commits
-------

20f9a5b Fixed syntax in comment
2019-12-13 15:06:44 -05:00