This PR was merged into the 4.4 branch.
Discussion
----------
[PHPDoc] Fix some union type cases
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
While working on https://github.com/symfony/symfony/issues/40154, I discovered some PHPDoc issues, I'm going to comment in the review. Upper branches will need some fixes too.
Commits
-------
dd1481642b [PHPDoc] Fix some union type cases
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Serializer] Construct annotations using named arguments
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | N/A
| License | MIT
| Doc PR | Not needed
This is the same as #40266, but applied to the serializer annotations.
This PR proposes to bump the `doctrine/annotations` library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing any of the serializer's annotation classes the old way by passing an array of parameters is deprecated.
### Reasons for this change
The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them:
* An array of parameters, passed as first argument, because that's the default behavior `doctrine/annotations`.
* A set of named arguments because that's how PHP 8 attributes work.
Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly.
### Drawback
After this change, there is no easy way anymore to construct instances of most of the annotation classes directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change.
Commits
-------
c11666264d [Serializer] Construct annotations using named arguments
This PR was merged into the 5.2 branch.
Discussion
----------
[Console] Add Helper::width() and Helper::length()
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Close#40697Fix#40634, fix#40635
| License | MIT
| Doc PR |
This PR will add add a Helper::strwidth() and a Helper::strlength(). Same with with the Helper::strlenWithoutDecoration(). It does not deprecate anything. That is done in #40695
With this PR we dont have to revert the emoji issue (ie close#40697)
FYI @grasmash, I used your tests from #40635
Commits
-------
d9ea4c597c Add test.
dc02ab3d74 [Console] Add Helper::strwidth() and Helper::strlength()
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[CI] Make sure packages contain all metafiles
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This PR introduce a new CI job to just do some checks on a package. It first looks at the git diff to figure out what packages have changed. Then for each changed package it verifies:
- .gitattributes exists
- .gitignore exists
- CHANGELOG.md exists
- LICENSE exists
- phpunit.xml.dist exists
- README.md exists
- The LICENSE file includes "Fabien Potencier", the correct year and has same content as /LICENSE
If the package is new (license file changed), we also make sure that the package is present in composer.json's replace.
I got this idea after seeing PRs like #40696. And we do add one or two package every month.
Commits
-------
18658a29a3 [CI] Make sure packages contain all metafiles
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Notifier] [CS] [5.x] Replace easy occurrences of ?: with ??
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
https://github.com/symfony/symfony/pull/40729 on 5.x
Commits
-------
726075c177 [CS] [5.x] Replace easy occurrences of ?: with ??
This PR was merged into the 5.3-dev branch.
Discussion
----------
* LightSmsTransport.php - suggestion for pull request #40712
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40712
| License | MIT
| Doc PR | -
After remove issets still get warnings about undefined variables. My solution for this:
1. Create method which have all issets cases.
2. Return (int) errorCode
Commits
-------
0b1a450194 * LightSmsTransport.php
This PR was merged into the 5.2 branch.
Discussion
----------
Update README.md
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | .
| License | MIT
| Doc PR | .
I think it can be a good idea to make a link from here to the book (Symfony v5.2+)
Commits
-------
fbd4cb2671 Update README.md
This PR was merged into the 5.2 branch.
Discussion
----------
[CS] [5.2] Replace easy occurrences of ?: with ??
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
https://github.com/symfony/symfony/pull/40727 on 5.2
Commits
-------
3f28f2ac31 [CS] [5.2] Replace easy occurrences of ?: with ??
This PR was merged into the 4.4 branch.
Discussion
----------
[CS] Replace easy occurences of ?: with ??
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Since we don't support PHP 5 anymore, we can easily replace `?:` with `??` when dealing with "nullable" objects. It seems more modern to me (make the code evolve with the new language features). Once we do not support < PHP 7.4, we can replace with `??=`.
Commits
-------
959d3d976c [CS] Replace easy occurences of ?: with ??
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Notifier] [FakeChat] Added the bridge
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/15171
| Recipe PR | todo
This PR is based on https://github.com/symfony/symfony/pull/39949 but for chat messages instead of SMS.
Commits
-------
0ce156c484 [Notifier] [FakeChat] Added the bridge
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Notifier] Mercure bridge: bump mercure dependency to 0.5
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/15179
Bump Mercure bridge's `symfony/mercure` dependency to 0.5 to deal with hubs instead of publishers.
---
To be able to use `HandlerRegistry::all` method, this PR needs https://github.com/symfony/mercure/pull/50 to be merged and released.
Commits
-------
498f96f1a8 Drop support of mercure:^0.4
d3306fdc92 add support for symfony/mercure:^0.5
This PR was merged into the 4.4 branch.
Discussion
----------
[Debug][ErrorHandler] Avoid warning with Xdebug 3 with develop mode disabled
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40677
| License | MIT
As reported in #40677, this fix is needed when Xdebug 3 is enabled but its `develop` mode is off.
Commits
-------
0e0639b129 Avoid warning with Xdebug 3 with develop mode disabled
This PR was merged into the 5.2 branch.
Discussion
----------
[Security] [Passport] improve dx and document AuthenticationException
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | tbd
`Passport::getUser()` (Instance of `UserPassportInterface::class`) throws an `AuthenticationException::class`
if a user does not exist. Let's document that for better DX and visibility.
Use case:
- User login w/ a `username` that does not exist (custom json authenticator)
- Attempt Authentication...
- Auth failed `LoginFailureEvent` dispatched
- snippet below:
```php
// Userland\LoginFailureEventSubscriber::class
public function dispatchFailure(LoginFailureEvent $event): void
{
$user = $event->getPassport()->getUser();
$message = new UserlandMessage($user);
$this->messageBus->dispatch($message);
}
```
- `401` status is returned.
The above subscriber fails silently because a `UsernameNotFoundException` was ultimately thrown from `UserBadge::getUser()`.
Commits
-------
97ceba0f5d improve dx and document auth exception
A badge on a passport is a critical security element, it determines which
security checks are run during authentication. Using the `required_badges`
setting, applications can make sure the expected security checks are run.
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Mailer][Notifier] added missing gitattributes and gitignore
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
just added missing .gitattributes and .gitignore to be consistent with other components
Commits
-------
00ac6d4b45 added missing gitattributes and gitignore
* 5.2:
added missing gitattributes and gitignore
allow CurlHttpClient on Windows
[Security] Mark ExpiredLoginLinkStorage as experimental
remove references to "Silex"