This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Allow doctrine/persistence 2
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Replaces #37416.
This PR unblocks the installation of `doctrine/persistence` version 2.
Notes:
* I had to bump `doctrine/data-fixtures` because composer would otherwise downgrade to an ancient alpha release with incomplete version constraints. This package is a dev dependency for our tests, so I think we're good here.
**edit**: Moved to #37640.
* Until doctrine/data-fixtures#349 has been resolved, Doctrine/Bridge cannot be tested with version 2 of `doctrine/persistence`.
Commits
-------
cd22fe6c92 Allow doctrine/persistence 2
This PR was merged into the 3.4 branch.
Discussion
----------
[DoctrineBridge] Bump doctrine/data-fixtures
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Discovered while working on #37639: DoctrineBridge is locked to an old an unmaintained branch of `doctrine/data-fixtures`. This is going to be a problem as soon as we want to support `doctrine/persistence` 2.
Commits
-------
4b611015d5 [DoctrineBridge] Bump doctrine/data-fixtures.
This PR was merged into the 3.4 branch.
Discussion
----------
[Lock][Cache] Fix Redis tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | /
In branch 3.4, travis started a redis-server container and tests run correctly.
Starting from 4.4, the travis test suite don't start the server anymore, which is not an issue for 4.4's tests because tests are skiped.
The issue is when branch 4.4 run the 3.4's test suite to check if component changes in 4.4 does not affect 3.4. in that case, the 3.4 tests suite is run without redise-server.
see https://travis-ci.org/github/symfony/symfony/jobs/711062047 for example
This PR replace the error handler (didn't worked) by catching the exception in a similar way than https://github.com/symfony/symfony/pull/36647
Commits
-------
f524c85161 Fix Redis tests
* 5.1:
Connect to RedisCluster with password auth
Fix PHPUnit 8.5 deprecations.
Fix EmailHeaderSame to make use of decoded value
Allow same middleware to be used multiple times with different arguments
* 5.0:
Connect to RedisCluster with password auth
Fix PHPUnit 8.5 deprecations.
Fix EmailHeaderSame to make use of decoded value
Allow same middleware to be used multiple times with different arguments
* 4.4:
Connect to RedisCluster with password auth
Fix PHPUnit 8.5 deprecations.
Fix EmailHeaderSame to make use of decoded value
Allow same middleware to be used multiple times with different arguments
This PR was merged into the 4.4 branch.
Discussion
----------
[Mime] Fix EmailHeaderSame to make use of decoded value
Fixes#35062
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? |no
| Deprecations? | no
| Tickets | Fix#35062
| License | MIT
Commits
-------
8a3f50746d Fix EmailHeaderSame to make use of decoded value
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Allow same middleware to be used multiple times with different arguments
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37568
| License | MIT
| Doc PR | -
Middleware service names now take into account arguments as well to allow the same middleware to be used multiple times with different arguments:
```yaml
framework:
messenger:
buses:
messenger.bus.default:
middleware:
- doctrine_ping_connection: ['main']
- doctrine_ping_connection: ['logs']
```
Commits
-------
d10e43d085 Allow same middleware to be used multiple times with different arguments
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.
Discussion
----------
[Cache] Connect to RedisCluster with password auth
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Currently it is not possible to connect to RedisCluster with password. AUTH param is described in documentation (last example) https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#configure-the-connection but totally ignored in the code and connection fails
```
RedisAdapter::createConnection(
'redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'
);
```
See RedisCluster usage here https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#declaring-a-cluster-with-an-array-of-seeds
Commits
-------
e873ddd72c Connect to RedisCluster with password auth
This PR was merged into the 3.4 branch.
Discussion
----------
[3.4] Fix PHPUnit 8.5 deprecations
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #37564
| License | MIT
| Doc PR | N/A
PHPUnit 8.5 introduced several deprecations. Addressing them will allow us to upgrade to PHPUnit 9.
Commits
-------
ec525e6e04 Fix PHPUnit 8.5 deprecations.
This PR was merged into the 5.1 branch.
Discussion
----------
[PhpUnitBridge] Fix tests on Windows
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
266fe76208 [PhpUnitBridge] Fix tests on Windows
* 5.1:
fix merge
Require PHPUnit 9.3 on PHP 8
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Removed @internal from Composite
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[Messenger] fix ignore account & endpoint options amazon sqs connection
[Serializer] Support multiple levels of discriminator mapping
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
[SCA] Minor fixes on tests
[WebProfilerBundle] modified url generation to use absolute urls
[Mailer] Fix reply-to functionality in the SendgridApiTransport
[Mime] Fix compat with HTTP requests
ticket_36879 - Fix mandrill raw http request setting from email/name
* 5.0:
fix merge
Require PHPUnit 9.3 on PHP 8
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[Serializer] Support multiple levels of discriminator mapping
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
[SCA] Minor fixes on tests
[WebProfilerBundle] modified url generation to use absolute urls
[Mailer] Fix reply-to functionality in the SendgridApiTransport
[Mime] Fix compat with HTTP requests
ticket_36879 - Fix mandrill raw http request setting from email/name
* 4.4:
fix merge
Require PHPUnit 9.3 on PHP 8
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[Serializer] Support multiple levels of discriminator mapping
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
[SCA] Minor fixes on tests
[WebProfilerBundle] modified url generation to use absolute urls
[Mailer] Fix reply-to functionality in the SendgridApiTransport
[Mime] Fix compat with HTTP requests
ticket_36879 - Fix mandrill raw http request setting from email/name
* 3.4:
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[SCA] Minor fixes on tests
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Require PHPUnit 9.3 on PHP 8
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
The first version of PHPUnit to support PHP 8.0 is PHPUnit 9.3.
---
Depends on https://github.com/symfony/symfony/pull/37607. Related to https://github.com/composer/composer/pull/9054.
Commits
-------
54b13c04c9 Require PHPUnit 9.3 on PHP 8
This PR was merged into the 4.4 branch.
Discussion
----------
[Serializer] Support multiple levels of discriminator mapping
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
When using multiple levels of discriminator mapping for denormalizing to a multiple level class hierarchy, only the top level discriminator mapping is considered, resulting in an error: **Cannot instantiate abstract class ...**
Example:
```php
/**
* @DiscriminatorMap(typeProperty="type", mapping={"group"=GroupNode::class, "item"=ItemNode::class})
*/
abstract class Node {
// ...
}
class GroupNode extends Node {
// ...
}
/**
* @DiscriminatorMap(typeProperty="item_type", mapping={"foo"=FooItemNode::class, "bar"=BarItemNode::class})
*/
abstract class ItemNode extends Node {
// ...
}
class FooItemNode {
// ...
}
class BarItemNode {
// ...
}
$objectNormalizer = new ObjectNormalizer(new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())));
$node = $objectNormalizer->denormalize(['type' => 'item', 'item_type' => 'foo']);
```
This results in an error: **Cannot instantiate abstract class ItemNode**. Expected is that `$node` is of type `FooItemNode` after denormalization.
The solution is to recursively call `AbstractObjectNormalizer::instantiateObject()` when a mapping is found, instead of always calling `parent::instantiateObject()`.
Commits
-------
324ad95fee [Serializer] Support multiple levels of discriminator mapping
This PR was merged into the 5.1 branch.
Discussion
----------
[Messenger] fix ignored account & endpoint options amazon sqs connection
| Q | A
| ------------- | ---
| Branch? | 5.1<!-- 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 | Fix#37598 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| 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 master.
-->
Commits
-------
fc90a3b7c6 [Messenger] fix ignore account & endpoint options amazon sqs connection
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] set default session.handler alias if handler_id is not provided
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37245
| License | MIT
| Doc PR |
Without a configured [`handler_id`](https://symfony.com/doc/current/session.html#configuration), the `session.handler` alias is not created, and somes services depend on this alias specialy.
Related to the reported issue above (affected version 4.4.9), the `ServiceHandlerInterface` is an alias of `session.handler`, when execute :
- `bin/console debug:container session.handler` : The alias is not defined, so the `ContainerDebugCommand` look for a service containing the `session.handler` as part of his name (ContainerDebugCommand::findServiceIdsContaining() is called and returns by default `session.handler.native_file`)
- `bin/console debug:container SessionHandlerInterface` : The service is defined as an alias of `session.handler`, when calling `ContainerBuilder::getDefinition('session.handler')` the exception occured as the alias is not defined.
# Implemented solution
Create a default `session.handler` when the param `handler_id` is not provided (I choosed `session.handler.native_file` rather than `NullSessionHandler`).
# Affected versions
From [`3.4`](https://github.com/symfony/framework-bundle/blob/3.4/DependencyInjection/FrameworkExtension.php#L879) to [`5.1`](https://github.com/symfony/framework-bundle/blob/5.1/DependencyInjection/FrameworkExtension.php#L955)
Commits
-------
46c8c3791b [FrameworkBundle] set default session.handler alias if handler_id is not provided
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.
Discussion
----------
[WebProfileBundle] Readability update
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
Updating ContentSecurityPolicyHandler by moving array out of foreach loop for ease of readability.
Commits
-------
6a7685f315 Readability update
This PR was submitted for the master branch but it was merged into the 5.1 branch instead.
Discussion
----------
Removed @internal from Composite
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#37348
| License | MIT
I think that Composite should not be @internal. Even with the new @Compound constraint Composite is still useful for complex custom validators.
For example, I have @ExcelColumn(string $column, array $constraints) that checks that all cells in a column of an uploaded Excel file are valid. This cannot be expressed with @Compound.
Commits
-------
8958ce12a1 Removed @internal from Composite
This PR was merged into the 3.4 branch.
Discussion
----------
Fix checks for phpunit releases on Composer 2
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37601
| License | MIT
| Doc PR | n/a
`simple-phpunit` has a core assumption that any version of PHPUnit without a stable release will only have one dev version returned by Composer. Per https://github.com/symfony/symfony/issues/37601, it's possible for Composer 2 to list **more than one dev version**. This breaks that assumption and therefore prevents the installation of 9.3.* ([which is needed for testing on PHP 8](https://github.com/sebastianbergmann/phpunit/pull/4374#issuecomment-657029594)).
The fix implemented here is to remove any versions containing `dev-` or `-dev` from the list of possible versions to see if any stable versions remain.
Commits
-------
2bb3f08fba Fix checks for phpunit releases on Composer 2 (resolves#37601)
This PR was merged into the 3.4 branch.
Discussion
----------
[SCA] Minor fixes on tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I mainly fixed misordered arguments in `assertEquals()`.
Commits
-------
b352ff08ad [SCA] Minor fixes on tests