Commit Graph

54246 Commits

Author SHA1 Message Date
Alexander M. Turek 3ea73c7b1d Don't use deprecated TestLogger class
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-18 18:17:37 +02:00
Alexander M. Turek 5ec14aa468 Merge branch '4.4' into 5.2
* 4.4:
  Indicate compatibility with psr/log 2 and 3

Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-18 17:21:43 +02:00
Alexander M. Turek 39c02d6b1a bug #42174 Indicate compatibility with psr/log 2 and 3 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Indicate compatibility with psr/log 2 and 3

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

Versions 2 and 3 of the PSR-3 interfaces have been published and most of our components are already compatible.

Commits
-------

d2209ec8dd Indicate compatibility with psr/log 2 and 3
2021-07-18 17:14:03 +02:00
Alexander M. Turek d2209ec8dd Indicate compatibility with psr/log 2 and 3
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-18 16:08:08 +02:00
Robin Chalas 586899c1bd
Merge branch '4.4' into 5.2
* 4.4:
  [ci] Fix wrongly skipped integration tests
2021-07-18 15:20:27 +02:00
Alexander M. Turek fa74feb846 minor #42171 [CI] Fix wrongly skipped integration tests (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[CI] Fix wrongly skipped integration tests

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

The integration tests from bridges located in components (e.g. `Notifier/Bridge/Discord/Tests` or `Messenger/Bridge/Redis/Tests`) were excluded from the CI.

Spotted while working on #42163 - Some redis-messenger tests are currently broken on 5.x, which we didn't spot because of the missing entry in the phpunit config.

Commits
-------

438a503cad [ci] Fix wrongly skipped integration tests
2021-07-18 14:29:31 +02:00
Robin Chalas 438a503cad
[ci] Fix wrongly skipped integration tests 2021-07-18 10:11:24 +02:00
Tobias Schultze fb6c26c096 Merge branch '4.4' into 5.2 2021-07-17 20:28:25 +02:00
Tobias Schultze 2e8eed88c4 minor #42013 [Form] backport type fixes (nicolas-grekas)
This PR was merged into the 5.2 branch.

Discussion
----------

[Form] backport type fixes

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

Backported from #41998

Commits
-------

75691c64d1 [Form] backport type fixes
2021-07-17 20:27:19 +02:00
Tobias Schultze 482d2ce7e3 minor #42158 Optimized some strlen() calls when possible (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

Optimized some strlen() calls when possible

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

Done with PhpStorm refactoring tools and only when it's safe to do.

Commits
-------

53aaa9ef7d Optimized some strlen() calls when possible
2021-07-17 20:04:51 +02:00
Tobias Schultze d78e3e586b minor #42153 [Validator] backport type fixes (Tobion)
This PR was merged into the 5.2 branch.

Discussion
----------

[Validator] backport type fixes

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| 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        |

Backport type fixes found when reviewing #42138

Commits
-------

969b28ec11 [Validator] backport type fixes
2021-07-17 20:03:41 +02:00
Tobias Schultze fa4052314b minor #42151 Use is_iterable() function when possible (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Use is_iterable() function when possible

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

PHP added `is_iterable()` in PHP 7.1.0 (see https://www.php.net/manual/en/function.is-iterable.php) and Symfony 4.4 requires `>=7.1.3`, so maybe we can use this function to simplify some code.

Commits
-------

6919c1317d Use is_iterable() function when possible
2021-07-17 19:53:37 +02:00
Javier Eguiluz 6919c1317d Use is_iterable() function when possible 2021-07-17 19:53:30 +02:00
Tobias Schultze 5aef1207c1 minor #42164 [Finder] Improve ComparatorTest (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder] Improve ComparatorTest

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/42137#discussion_r671074444, https://github.com/symfony/symfony/pull/42137#discussion_r671073659
| License       | MIT
| Doc PR        | not necessary

Commits
-------

4c44dce968 [Finder] Improve ComparatorTest
2021-07-17 19:52:49 +02:00
Alexander M. Turek 2fe4b00e60 minor #42154 [Validator] Add German expression language syntax constraint violation message (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Add German expression language syntax constraint violation message

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

Commits
-------

1d6d57d179 Add German expression language syntax constraint violation message
2021-07-17 00:54:28 +02:00
Alexander M. Turek 4c44dce968 [Finder] Improve ComparatorTest
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-17 00:13:12 +02:00
Javier Eguiluz 53aaa9ef7d Optimized some strlen() calls when possible 2021-07-16 15:30:15 +02:00
Christian Flothmann 1d6d57d179 Add German expression language syntax constraint violation message 2021-07-16 14:15:14 +02:00
Christian Flothmann d47cb59eee Merge branch '4.4' into 5.2
* 4.4:
  fix LDAP command usage
2021-07-16 14:07:40 +02:00
Christian Flothmann 290f76f867 minor #42152 fix LDAP command usage (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

fix LDAP command usage

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

Commits
-------

39c838c3ed fix LDAP command usage
2021-07-16 14:06:59 +02:00
Christian Flothmann 39c838c3ed fix LDAP command usage 2021-07-16 13:56:54 +02:00
Tobias Schultze 969b28ec11 [Validator] backport type fixes 2021-07-16 13:50:32 +02:00
Robin Chalas 32c46c018f
minor #42144 [RateLimiter] Remove redundant properties (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[RateLimiter] Remove redundant properties

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

Backported from #42140: Those three classes use `ResetLimiterTrait` and redeclare the properties that the trait already provides. This PR removes that redundancy.

Commits
-------

587d99f44a [RateLimiter] Remove redundant properties
2021-07-16 00:19:05 +02:00
Alexander M. Turek 587d99f44a [RateLimiter] Remove redundant properties
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-16 00:07:55 +02:00
Alexander M. Turek bd889f99b1 Merge branch '4.4' into 5.2
* 4.4:
  [Validator] Backport type fixes
  [HttpFoundation] fix FileBag under PHP 8.1
  Fix composer resolution on windows
2021-07-15 23:36:33 +02:00
Alexander M. Turek 76d41cd273 minor #42141 [Validator] Backport type fixes (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Backport type fixes

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

Backports from #42138.

Commits
-------

f9bb7ba074 [Validator] Backport type fixes
2021-07-15 23:35:37 +02:00
Alexander M. Turek f9bb7ba074 [Validator] Backport type fixes
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-15 22:38:28 +02:00
Alexander M. Turek 6cd50ad0a0 bug #42112 [HttpFoundation] fix FileBag under PHP 8.1 (alexpott)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] fix FileBag under PHP 8.1

| Q             | A
| ------------- | ---
| Branch?       | 4.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 #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

See https://php.watch/versions/8.1/$_FILES-full-path - in \Symfony\Component\HttpFoundation\FileBag::convertFileInformation() we check against a list of hardcoded keys. This logic breaks in PHP 8.1 because of the new key.

Commits
-------

dc3504989b [HttpFoundation] fix FileBag under PHP 8.1
2021-07-15 19:37:22 +02:00
Alex Pott dc3504989b [HttpFoundation] fix FileBag under PHP 8.1 2021-07-15 19:37:16 +02:00
Nicolas Grekas 6b2b7b983c bug #42131 [PhpUnitBridge] Fix composer resolution on Windows (Rainrider)
This PR was submitted for the 5.4 branch but it was merged into the 4.4 branch instead.

Discussion
----------

[PhpUnitBridge] Fix composer resolution on Windows

| Q             | A
| ------------- | ---
| Branch?       | 4.4 and next
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #42129
| 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/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

This prepends the php executable to the resolved composer path even when `COMPOSER_BINARY` is set on Windows. Please see #42129 for description.

Commits
-------

746f83adbc Fix composer resolution on windows
2021-07-15 16:30:44 +02:00
Rainrider 746f83adbc Fix composer resolution on windows
Prepend the php executable to the resolved composer path
when `COMPOSER_BINARY` is set.
2021-07-15 16:30:38 +02:00
Alexander M. Turek 7198c225dd Merge branch '4.4' into 5.2
* 4.4:
  [FrameworkBundle] Fix broken mock
2021-07-15 16:28:40 +02:00
Alexander M. Turek a4992b01e8 minor #42132 [FrameworkBundle] Fix broken mock (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Fix broken mock

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

Backport from #42109. The mocked implementations of `getInheritData()` and `getName()` will currently return `null` which is something the real implementation would never do.

Commits
-------

6d2f428911 [FrameworkBundle] Fix broken mock
2021-07-15 16:09:11 +02:00
Alexander M. Turek 6d2f428911 [FrameworkBundle] Fix broken mock
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-15 15:09:03 +02:00
Alexander M. Turek c1e42d4a80 Merge branch '4.4' into 5.2
* 4.4:
  [Form] Backport type fixes
  [Finder] Fix iterator return types
  [DependencyInjection] Support for intersection types
2021-07-15 14:19:23 +02:00
Alexander M. Turek f8b18ce90b minor #42110 [Form] Backport type fixes (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] Backport type fixes

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

Backports from #42109

Commits
-------

289a7680ff [Form] Backport type fixes
2021-07-15 14:04:12 +02:00
Alexander M. Turek 289a7680ff [Form] Backport type fixes
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-15 14:00:28 +02:00
Nicolas Grekas c9e4c33c0f bug #42097 [DependencyInjection] Support for intersection types (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Support for intersection types

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

Commits
-------

d28cf24258 [DependencyInjection] Support for intersection types
2021-07-15 13:47:34 +02:00
Nicolas Grekas 404a7cef24 minor #42113 [Finder] Fix iterator return types (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder] Fix iterator return types

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

This PR fixes deprecation warnings on PHP 8.1 related to missing return types of iterator implementations.

Commits
-------

2ede10d762 [Finder] Fix iterator return types
2021-07-15 13:43:23 +02:00
Alexander M. Turek 2ede10d762 [Finder] Fix iterator return types
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-15 12:39:41 +02:00
Nicolas Grekas 6f5e0c09a9 Merge branch '4.4' into 5.2
* 4.4:
  [ErrorHandler] fix parsing `@return array<foo>` annotations
2021-07-15 11:09:21 +02:00
Nicolas Grekas b8cbb93caa [ErrorHandler] fix parsing `@return array<foo>` annotations 2021-07-15 11:09:11 +02:00
Nicolas Grekas 92d0594cd5 Merge branch '4.4' into 5.2
* 4.4:
  [HttpFoundation] Fix return types of SessionHandler::gc()
  [Cache] Support decorated Dbal drivers in PdoAdapter
  [VarDumper] Support for intersection types
2021-07-15 10:59:55 +02:00
Nicolas Grekas 6c8114ad2a bug #42114 [HttpFoundation] Fix return types of SessionHandler::gc() (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Fix return types of SessionHandler::gc()

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

`SessionHandler::gc()` should return the number of garbage-collected sessions. We often return `true` which violates that contract.

Commits
-------

1261a4139d [HttpFoundation] Fix return types of SessionHandler::gc()
2021-07-15 10:23:19 +02:00
Nicolas Grekas b1fbd1b8f1 bug #42099 [VarDumper] Support for intersection types (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Support for intersection types

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

Commits
-------

3cf105766a [VarDumper] Support for intersection types
2021-07-15 09:45:25 +02:00
Alexander M. Turek 1261a4139d [HttpFoundation] Fix return types of SessionHandler::gc()
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-07-15 02:12:10 +02:00
Tobias Schultze e5c96c4051 bug #42011 [Cache] Support decorated Dbal drivers in PdoAdapter (Jeroeny)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Cache] Support decorated Dbal drivers in PdoAdapter

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

Doctrine v3 supports middleware for Drivers. Upon creating the Connection, `middleware->wrap(Driver): Driver` [is called](https://github.com/doctrine/dbal/blob/3.1.x/src/DriverManager.php#L210), in which the middleware can wrap/decorate the Driver class. So that it can perform tracing [for example](https://github.com/getsentry/sentry-symfony/blob/master/src/Tracing/Doctrine/DBAL/TracingDriverMiddleware.php#L37).

When this happens, the Driver class inside the Connection is no longer one of Doctrine's well known Driver classes. The `PdoAdapter ` uses this class to determine the database platform. Which breaks once the Driver is decorated and no longer one of the classes [listed](https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Cache/Adapter/PdoAdapter.php#L452) in the `PdoAdapter`.

Since Dbal exposes this middleware as a feature, I think it would be nice for the `PdoAdapter` to support this.

To solve this, the `getDatabasePlatform` can be used. This returns a `Doctrine\DBAL\Platforms\AbstractPlatform` which defines the abstract method `getName`. This returns a value very similar to the list in the `PdoAdapter`. The names don't match exactly, so therefor a small mapping is done to get right the name used in the adapter. As far as a I know, there'd be no other implications with this change.

Related: https://github.com/getsentry/sentry-symfony/issues/530

Commits
-------

58d74e30be [Cache] Support decorated Dbal drivers in PdoAdapter
2021-07-14 22:18:05 +02:00
Jeroeny 58d74e30be [Cache] Support decorated Dbal drivers in PdoAdapter 2021-07-14 22:17:56 +02:00
Alexander M. Turek aa942208ac Merge branch '4.4' into 5.2
* 4.4:
  qa: add missing type-hints to workflow `Transition`
  Declare returned type.
2021-07-14 18:35:24 +02:00
Alexander M. Turek 93270312d8 minor #41995 [EventDispatcher] Declare return type of `getSubscribedEvents()` (Warxcell)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] Declare return type of `getSubscribedEvents()`

Fixes

Method getSubscribedEvents() return type has no value type specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

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

Commits
-------

9ba0a9118a Declare returned type.
2021-07-14 18:34:33 +02:00