* 5.1:
[Debug] fix test
consistently use same types for strict comparisons
[PhpUnitBridge] Skip internal classes in CoverageListenerTrait
[VarExporter] unserialize() might throw an Exception on php 8.
[SecurityHttp] Don't call createMock() with multiple interfaces.
[ErrorHandler] Parse "x not found" errors correctly on php 8.
Prevent parsing invalid octal digits as octal numbers
remove unnecessary check for existing request
[DI] fix ContainerBuilder on PHP8
[Console] Make sure $maxAttempts is an int or null.
[VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
[Intl] Skip test cases that produce a TypeError on php 8.
[PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
[PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
add bosnian (bs) translation
[Debug] Parse "x not found" errors correctly on php 8.
* 4.4:
[Debug] fix test
consistently use same types for strict comparisons
[PhpUnitBridge] Skip internal classes in CoverageListenerTrait
[VarExporter] unserialize() might throw an Exception on php 8.
[ErrorHandler] Parse "x not found" errors correctly on php 8.
Prevent parsing invalid octal digits as octal numbers
remove unnecessary check for existing request
[DI] fix ContainerBuilder on PHP8
[Console] Make sure $maxAttempts is an int or null.
[VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
[Intl] Skip test cases that produce a TypeError on php 8.
[PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
[PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
add bosnian (bs) translation
[Debug] Parse "x not found" errors correctly on php 8.
This PR was merged into the 4.4 branch.
Discussion
----------
[Debug] fix test
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
16a76739c0 [Debug] fix test
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Process] allow setting options esp. "create_new_console" to detach a subprocess
Process.php to include support for create_new_console (Windows ONLY)
| 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 | #36583 <!-- 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 -->
Based on this issue: https://github.com/symfony/symfony/issues/36583
I created a quick repo [ https://github.com/andrei0x309/tets_sym_proc]( https://github.com/andrei0x309/tets_sym_proc) to illustrate
how this feature can be used, it essentially lets you run something even if your main script has terminated.
It is useful if you want to create something like
`new Process(['php', 'script_with_long_execution_time.php']);`
This was impossible to do on windows until the **create_new_console** flag was added in PHP 7.4.4.
With this feature Process can be used like this:
```
// Start a process and detach form it on Win only
$process = new Process(['php', 'worker.php']);
$process->setOptions(["create_new_console" => true]); // New method I added
$process->disableOutput();
$process->start();
Process Class behavior will never change if the user doesn't use setWinOptions()
```
Commits
-------
e9ab235b66 [Process] allow setting options esp. "create_new_console" to detach a subprocess
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] consistently use same types for strict comparisons
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
afc11684e0 consistently use same types for strict comparisons
* 3.4:
Prevent parsing invalid octal digits as octal numbers
[DI] fix ContainerBuilder on PHP8
[Console] Make sure $maxAttempts is an int or null.
[VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
[Intl] Skip test cases that produce a TypeError on php 8.
[PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
[PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
add bosnian (bs) translation
[Debug] Parse "x not found" errors correctly on php 8.
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[PhpUnitBridge] Skip internal classes in CoverageListenerTrait
PHPUnit 9+ is picky about test covering, say, a `\RuntimeException`. Fails with the likes:
"@covers RuntimeException" is invalid
Judging by the commit e06850c12b this change is required for PHPUnit 9.1 and up. [Here's it being tested.](60c6fb972b/tests/unit/ClassMethodUnitTest.php (L49-L54))
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Follow-up to #38054
| License | MIT
Commits
-------
a0dedb9aa6 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
This PR was merged into the 4.4 branch.
Discussion
----------
[VarExporter] unserialize() might throw an Exception on php 8
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #36872
| License | MIT
| Doc PR | N/A
VarExporter attempts a deserialization in order to check if a given object can be exported in serialized form. On php 8, the `unserialize` call might throw an exception that needs to be caught and converted to the expected `NotInstantiableTypeException`.
Commits
-------
65112e11bc [VarExporter] unserialize() might throw an Exception on php 8.
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] Parse "x not found" errors correctly on php 8
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #36872
| License | MIT
| Doc PR | N/A
This PR is #38049 applied to the 4.4 branch.
Commits
-------
d9c9aea7ee [ErrorHandler] Parse "x not found" errors correctly on php 8.
This PR was merged into the 3.4 branch.
Discussion
----------
Prevent parsing invalid octal digits as octal numbers
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Values starting with `0` but containing `8` or `9` such as `0123456789` are not valid octal numbers, therefore they should be parsed as regular strings. This is consistent with how other invalid octal values are parsed, e.g. `01234567ab` already gets parsed as the string `"01234567ab"`.
Commits
-------
c7dcd82f03 Prevent parsing invalid octal digits as octal numbers
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Remove unnecessary check for existing request
| 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 | Fix#38035 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | - <!-- required for new features -->
<!--
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
-------
3feff72186 remove unnecessary check for existing request
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[MonologBridge] Added SwitchUserTokenProcessor to log the impersonator
| 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 | 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 -->
This pull request adds the ability to log the impersonator user in case of user impersonation feature usage. The current TokenProcessor logs only the current token and there are no ability to simply log the original token, so we need to copy-paste the TokenProcessor and change a few lines to log the original token
Commits
-------
2f8651d4ec [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator
This PR was merged into the 5.2-dev branch.
Discussion
----------
[DependencyInjection] Add the Required attribute
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | TODO
This PR proposes a new attribute `#[Required]` that can be used instead of the `@required` annotation.
Commits
-------
ea262441e7 [DependencyInjection] Add the Required attribute.
This PR was merged into the 5.2-dev branch.
Discussion
----------
[RFC][Routing] Added the Route attribute
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | not yet
I was wondering if we can make use of [attributes](https://wiki.php.net/rfc/attributes_v2) as a replacement for Doctrine Annotations for configuring routes.
I have modified the existing `AnnotationClassLoader` so that it merges attributes and annotations. This way, an application could transparently switch from annotations to attributes. Moreover, the `AnnotationClassLoader` does not require an annotation reader anymore.
Since the chosen syntax `#[…]` is treated as a comment by php 7, I was able to use the existing annotation class, which makes the migration even easier.
#### Example with Doctrine Annotations
```php
use Symfony\Component\Routing\Attribute\Route;
class ActionPathController
{
/**
* @Route("/path", name: "action")
*/
public function action()
{
}
}
```
#### Same example with the proposed Attribute
```php
use Symfony\Component\Routing\Attribute\Route;
class ActionPathController
{
#[Route('/path', name: 'action')]
public function action()
{
}
}
```
Commits
-------
f0978de493 [Routing] Added the Route attribute.
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] with "bindto" with NativeHttpClient
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38081
| License | MIT
| Doc PR | -
/cc @derrabus
Commits
-------
cea05311fc [HttpClient] with "bindto" with NativeHttpClient
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
As seen in https://github.com/symfonycorp/cloud-templates/pull/15, having the path of the preload file vary by env+debug makes configuring PHP.ini settings impossible.
This PR dump a new `preload.php` file in `src/` when `cache:clear` is called.
This makes the path predictable.
This is submitted as a bugfix because the current behavior is barely usable without this change.
Commits
-------
54c965c7d0 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
* 4.4:
[HttpKernel] Adjust tests to new "class not found" error message format.
Don't call createMock with an array of interfaces.
[FrameworkBundle] Fix Tests on PHPUnit 9.3.
[WebProfilerBundle] Fix Tests on PHPUnit 9.3.
esmtp error not being thrown properly
[Yaml Parser] fixed Parser to skip comments when inlining sequences
[DI] fix generating preload file when cache_dir is outside project_dir
Fix CacheCollectorPass with decorated cache pools
[PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
Remove invalid instantiation declaration
[PropertyInfo] Fix typed collections in PHP 7.4
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Fix Tests on PHPUnit 9.3
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #37564
| License | MIT
| Doc PR | N/A
When joining two constraints with a `LogicalAnd`, PHPUnit will generate a failure message where the message omitted by the first constraint will be wrapped in parenthesis. I'm using a regular expression now, so we can support both variants.
Commits
-------
8bc36d7420 [FrameworkBundle] Fix Tests on PHPUnit 9.3.