This PR was merged into the 5.2-dev branch.
Discussion
----------
[FrameworkBundle] do not use deprecated mailer.logger_message_listener service
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
0e93216322 do not use deprecated mailer.logger_message_listener service
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[Serializer] Add CompiledClassMetadataFactory
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ?
| License | MIT
| Doc PR | todo (issue: https://github.com/symfony/symfony-docs/issues/10706)
This introduce a dumped `ClassMetadataFactoryInterface` implementation to speed up the serializer by leveraging [PHP7 immutable array](https://blog.blackfire.io/php-7-performance-improvements-immutable-arrays.html).
Like for https://github.com/symfony/symfony/pull/28865, if the user have the opcache extension enabled, the compilation time will be skipped. The user will also have a performance boost when not using opcache as we are no longer fetching `ClassMetadata` from the PSR-6 cache.
This allow to speed up the normalization (without opcache) by 9-12% depending on how many objects are involved in the graph:
- [SymfonyObjectNormalizerBenchmark, 100 iterations with complexity of 1](https://blackfire.io/profiles/compare/d937a9cc-eebf-47eb-be90-c8e65cdf12b3/graph)
- [SymfonyObjectNormalizerBenchmark, 3 iterations with complexity of 60](https://blackfire.io/profiles/compare/d490542c-9a79-48a0-b7bc-1ed3ca6a9148/graph)
On the `FrameworkBundle` side, I suggest to add a `CacheWarmer` to dump the metadata array from configured class list. The list could have a _good_ default which will load the classes found in `src/Entity`.
## Dumping the `ClassMetadata`
```php
$classMetadatas = [];
foreach([Category::class, Comment::class, Forum::class, Thread::class, User::class] as $class) {
$classMetadatas[] = $this->classMetadataFactory->getMetadataFor($class);
}
file_put_contents('dumped.php', $this->classMetadataFactoryCompiler->compile($classMetadatas));
```
## Using the dumped `ClassMetadata`
```php
$classMetadataFactory = new CompiledClassMetadataFactory(
'dumped.php',
new CacheClassMetadataFactory(
new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())),
new ApcuAdapter('SymfonyMetadata')
)
);
```
# To do
- [x] Tests.
- [x] Cache warmer.
- [x] Documentation.
- [x] Changelog entry.
Commits
-------
63cbf0abe8 [Serializer] Add CompiledClassMetadataFactory
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Stopwatch] Add name property to the stopwatchEvent
| Q | A
| ------------- | ---
| Branch? | master for features
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#37627
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
f2b64ecc6a Add name property to the stopwatchEvent
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[Yaml] Fix for #36624; Allow PHP constant as first key in block
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#36624
| License | MIT
| Doc PR |
When using a PHP constant in the first key of a mapping the parser would throw an exception. However if you used a PHP constant in any other key but the first it was allowed. This fix allows PHP constant as the first key.
I've included a test for this parser error along with the fix.
Commits
-------
46f635c492 [Yaml] Fix for #36624; Allow PHP constant as first key in block
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] fix mapping errors from unmapped forms
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#10519
| License | MIT
| Doc PR |
Commits
-------
235920a388 fix mapping errors from unmapped forms
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Messenger] Add method HandlerFailedException::getNestedExceptionOfClass
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
| Doc PR | in progress
I have many times use this kind of code on my own development. It helps when dealing with specific exception through a Messenger usage.
Example in an ExceptionListener, the exception you get could be a `HandlerFailedException` but you want a specific treatment when the original exception is different (like a RedirectResponse, or Http error code different).
edit: I finally also added a getNestedExceptionOfClass that could be useful too
Commits
-------
e0dd84b426 [Messenger] Add method HandlerFailedException::getNestedExceptionOfClass
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Console] Table: support cells with newlines after a cell with colspan >= 2
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
When rendering a table with a cell containing newlines after a cell with
colspan set to at least 2, every line in the cell with newlines except the
first one fails to render.
This case is fixed by calling `->fillCells()` on the unmerged rows and
implementing support for rows that start with a non-zero index for the columns.
While fixing this, I discovered another issue with colspan: if a cell following a
colspanned cell contains enough newlines to make the contents extend further
than the colspanned cell's contents, the cells become misaligned. This is now
also fixed.
Commits
-------
ca11772e3f [Console] Table: support cells with newlines after a cell with colspan >= 2
This PR was merged into the 5.2-dev branch.
Discussion
----------
Revert "[DependencyInjection] Resolve parameters in tag arguments"
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #35337
| License | MIT
| Doc PR | N/A
Revert of earlier PR, see discussion https://github.com/symfony/symfony/pull/37243
Commits
-------
9731451b5a Revert "[DependencyInjection] Resolve parameters in tag arguments"
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Fix redis connect with empty password
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix -
| License | MIT
| Doc PR | symfony/symfony-docs#...
If you use DSN like this it will fail as auth is called with an empty password:
```env
redis://%env(resolve:REDIS_PASSWORD)%@%env(resolve:REDIS_HOST)%
```
The auth should only be called when a password is set to a specific string.
Else it will fail with:
> ERR Client sent AUTH, but no password is set
Redis Conf "redis-nopass.conf":
```ini
requirepass ""
```
Commits
-------
9946f7fecf Fix redis connect with empty password
This PR was merged into the 5.2-dev branch.
Discussion
----------
[HttpKernel] Provide status code in fragment handler exception
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
We have a use case where it would be useful to retrieve the status code in an exception listener from the exception thrown by the fragment handler, current solution is to extract it from the exception string which is ugly.
With this change we can get the status code from the exception directly.
Commits
-------
81ca1f00a3 [HttpKernel] Provide status code in fragment handler exception
* 5.1:
Fix typo
Fix deprecated libxml_disable_entity_loader
Add Tagalog translations for validator messages 94, 95, 96 and 99
PHPUnit's assertContains() performs strict comparisons now.
[ClassLoader][Routing] Fix namespace parsing on php 8.
Fix deprecated libxml_disable_entity_loader
Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
[Validator] Add missing translations for german and vietnamese
Modernized deprecated PHPUnit assertion calls
[Console] The message of "class not found" errors has changed in php 8.
The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
[Console] Make sure we pass a numeric array of arguments to call_user_func_array().
Remove outdated references from base_js.html.twig file
[String] We cannot have a "provides" function in test cases.
Typo: somes styles fixed
[Serializer] Fix that it will never reach DOMNode
[Validator] sync translations
[VarDumper] Improve previous fix on light array coloration
[Cache] Fix#37667
* 4.4:
Fix typo
Fix deprecated libxml_disable_entity_loader
Add Tagalog translations for validator messages 94, 95, 96 and 99
PHPUnit's assertContains() performs strict comparisons now.
[ClassLoader][Routing] Fix namespace parsing on php 8.
Fix deprecated libxml_disable_entity_loader
Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
[Validator] Add missing translations for german and vietnamese
Modernized deprecated PHPUnit assertion calls
[Console] The message of "class not found" errors has changed in php 8.
The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
[Console] Make sure we pass a numeric array of arguments to call_user_func_array().
[Serializer] Fix that it will never reach DOMNode
[Validator] sync translations
[VarDumper] Improve previous fix on light array coloration
[Cache] Fix#37667
* 3.4:
Add Tagalog translations for validator messages 94, 95, 96 and 99
PHPUnit's assertContains() performs strict comparisons now.
[ClassLoader][Routing] Fix namespace parsing on php 8.
Fix deprecated libxml_disable_entity_loader
Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
[Validator] Add missing translations for german and vietnamese
Modernized deprecated PHPUnit assertion calls
[Console] The message of "class not found" errors has changed in php 8.
The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
[Console] Make sure we pass a numeric array of arguments to call_user_func_array().
[Serializer] Fix that it will never reach DOMNode
[Validator] sync translations
[VarDumper] Improve previous fix on light array coloration
[Cache] Fix#37667
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
Add Tagalog translations for validator messages 94, 95, 96 and 99
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- 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 | Fix #... <!-- 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.
-->
I had a little pocket of free time and decided to add a few translations. I wasn't 100% sure about the most natural way to translate 97 and 98, hence why I left them out for now. I'll add them afterwards when I get more time to think about them.
Commits
-------
9d126e085e Add Tagalog translations for validator messages 94, 95, 96 and 99
This PR was merged into the 3.4 branch.
Discussion
----------
PHPUnit's assertContains() performs strict comparisons
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Part of #37564
| License | MIT
| Doc PR | N/A
In PHPUnit 9.3, `assertContains()` performs a strict comparison which causes a few test failures in our test suite. This PR should fix them.
Commits
-------
9f4dec59a4 PHPUnit's assertContains() performs strict comparisons now.
This PR was merged into the 3.4 branch.
Discussion
----------
[ClassLoader][Routing] Fix namespace parsing on php 8
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
The way namespace declarations are parsed has changed in php 8 (see php/php-src#5827). This PR should fix the corresponding issues in the ClassLoader and Routing components.
Note that Doctrine Annotations suffers from the same issue (doctrine/annotations#339). I had to run the Routing tests locally with doctrine/annotations#344 applied.
Commits
-------
3d293b298f [ClassLoader][Routing] Fix namespace parsing on php 8.
This PR was merged into the 3.4 branch.
Discussion
----------
Made reference to PHPUnit\Util\XML::loadfile php5-compatible
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Fixup of #37778. My code was apparently not php5-friendly. Sorry for that. 😓
Commits
-------
4bf640543a Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Notifier] added telegram options
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
I have added `TelegramOptions` model for sending a telegram message with options like the example I have used `SlackOptions`.
Testing notes:
1) Create telegram bot https://core.telegram.org/bots#creating-a-new-bot
2) Open telegram and join to the created chat
3) Send a message to telegram
for testing, I used the scripts
[scripts.zip](https://github.com/symfony/symfony/files/4499901/scripts.zip)
Commits
-------
3ba8d8f135 [Notifier] added telegram options
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[Validator] Add missing translations for german and vietnamese
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- 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 -->
| 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
-------
f4bd34a1a8 [Validator] Add missing translations for german and vietnamese
This PR was merged into the 5.2-dev branch.
Discussion
----------
[FrameworkBundle] Add days before expiration in "about" command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes (with RFC)
| Deprecations? | no
| Tickets | Slack discussion + see RFC below
| License | MIT
| Doc PR |
Maybe this can be usefull in the `bin/console about` output.
Following a small discussion on Slack
<details>
<summary>See discussion </summary>
<img width="910" alt="sf_slack" src="https://user-images.githubusercontent.com/13205768/89516646-029dea00-d7d9-11ea-8ff5-eed5ae72fc77.png">
</details>
---
Symfony 5.1 output:
<img width="681" alt="sf51" src="https://user-images.githubusercontent.com/13205768/89515902-067d3c80-d7d8-11ea-8676-1f90dd0a3418.png">
---
Symfony 5.foo_bar output:
With:
```php
// symfony/http-kernel/Kernel.php
const END_OF_MAINTENANCE = '08/2020'; // this month
const END_OF_LIFE = '09/2020'; // next month
```
<img width="680" alt="sf51_fake" src="https://user-images.githubusercontent.com/13205768/89516056-375d7180-d7d8-11ea-9345-83db200a693d.png">
---
## RFC
Is there a way in Symfony land packages to have such info or/and in Composer in general? the EOL of a package version.
Like for example the https://github.com/FriendsOfPHP/security-advisories `Security Advisories` feature,
but for `End Of Life Advisories` where packages maintainers can add their packages, and this data can be read by `composer` or an other command
~Or maybe directly inside the `composer.json`, like an `"eol": "true"` // and `false` by default if not defined~ (not possible)
Thanks
Commits
-------
0b0a1f6f8e Add days before expiration in "about" command
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Make sure we pass a numeric array of arguments to call_user_func_array()
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
On php 8, the unit tests fail with the following error:
```
ArgumentCountError: array_merge() does not accept unknown named parameters
```
This PR should fix the issue.
Commits
-------
67102c32e6 [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
Modernized deprecated PHPUnit assertion calls
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Part of #37564
| License | MIT
| Doc PR | N/A
Some assertions have been renamed in PHPUnit 9. PhpUnitBridge should already have polyfills in place for those methods, so it should be save to use them.
Commits
-------
ab417f7040 Modernized deprecated PHPUnit assertion calls
This PR was merged into the 5.2-dev branch.
Discussion
----------
[PhpUnitBridge] Fix assertDoesNotMatchRegularExpression() polyfill
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
The `assertDoesNotMatchRegularExpression()` polyfill currently does not work because the `$pattern` argument is not passed down correctly.
Commits
-------
cdd727a93b [PhpUnitBridge] Fix assertDoesNotMatchRegularExpression() polyfill.