Skip to content

Commit fa25bef

Browse files
Merge branch '5.4' into 5.3
* 5.4: (553 commits) [Profiler] relax return type for memory data collector fix merge [PropertyInfo] Fix phpstan extractor issues Expand FormView key to include int [PropertyInfo] PhpStan extractor nested object fix [WebProfilerBundle] fix Email HTML preview Don't rely on session service in tests [Console] Fix autocompletion of argument with default value Properly warn about deprecation of IS_AUTHENTICATED_ANONYMOUSLY [Lock] Create tables in transaction only if supported by driver [HttpFoundation] Take php session.cookie settings into account [ErrorHandler] fix on patching return types on Windows [5.4] cs fixes Revert "feature #41989 [Cache] make `LockRegistry` use semaphores when possible (nicolas-grekas)" [HttpKernel] fix how configuring log-level and status-code by exception works [Serializer] Improve UidNormalizer denormalize error message [Validator] Allow Sequence constraint to be applied onto class as an attribute [Lock] Fix missing argument in PostgreSqlStore::putOffExpiration with DBAL connection Bump Symfony version to 5.4.2 Update VERSION for 5.4.1 ...
2 parents f4e0e65 + c4922fb commit fa25bef

File tree

2,053 files changed

+46487
-7552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,053 files changed

+46487
-7552
lines changed

.github/patch-types.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
3131
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/'):
3232
case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
33-
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'):
34-
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'):
33+
case false !== strpos($file, '/src/Symfony/Component/Form/Tests/Fixtures/Answer.php'):
34+
case false !== strpos($file, '/src/Symfony/Component/Form/Tests/Fixtures/Number.php'):
35+
case false !== strpos($file, '/src/Symfony/Component/Form/Tests/Fixtures/Suit.php'):
36+
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/'):
3537
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php81Dummy.php'):
3638
case false !== strpos($file, '/src/Symfony/Component/Runtime/Internal/ComposerPlugin.php'):
39+
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Fixtures/'):
3740
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
41+
case false !== strpos($file, '/src/Symfony/Component/Validator/Tests/Fixtures/NestedAttribute/Entity.php'):
3842
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
3943
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/ReflectionIntersectionTypeFixture.php'):
4044
continue 2;

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
uses: shivammathur/setup-php@v2
123123
with:
124124
coverage: "none"
125-
extensions: "json,couchbase,memcached,mongodb,redis,rdkafka,xsl,ldap"
125+
extensions: "json,couchbase,memcached,mongodb-1.10.0,redis,rdkafka,xsl,ldap"
126126
ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
127127
php-version: "${{ matrix.php }}"
128128
tools: pecl
@@ -146,7 +146,7 @@ jobs:
146146
echo COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION >> $GITHUB_ENV
147147
148148
echo "::group::composer update"
149-
composer require --dev --no-update mongodb/mongodb:@stable
149+
composer require --dev --no-update mongodb/mongodb:"1.9.1@dev|^1.9.1@stable"
150150
composer update --no-progress --ansi
151151
echo "::endgroup::"
152152

.github/workflows/psalm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: shivammathur/setup-php@v2
1818
with:
1919
php-version: '8.0'
20-
extensions: "json,memcached,mongodb,redis,xsl,ldap,dom"
20+
extensions: "json,couchbase,memcached,mongodb,redis,xsl,ldap,dom"
2121
ini-values: "memory_limit=-1"
2222
coverage: none
2323

.github/workflows/unit-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ jobs:
151151
if: "matrix.php == '8.1' && ! matrix.mode && matrix.os != 'macos-11'"
152152
run: |
153153
sed -i 's/"\*\*\/Tests\/"//' composer.json
154+
git add .
154155
composer install -q --optimize-autoloader
155-
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php
156-
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php # ensure the script is idempotent
156+
SYMFONY_PATCH_TYPE_DECLARATIONS='force=1&php=7.2' php .github/patch-types.php
157+
SYMFONY_PATCH_TYPE_DECLARATIONS='force=1&php=7.2' php .github/patch-types.php # ensure the script is idempotent
158+
git diff --exit-code
157159
echo PHPUNIT="$PHPUNIT,legacy" >> $GITHUB_ENV
158160
159161
- name: Run tests

.php-cs-fixer.dist.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
4343
// explicit trigger_error tests
4444
->notPath('Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php')
45+
// stop removing spaces on the end of the line in strings
46+
->notPath('Symfony/Component/Messenger/Tests/Command/FailedMessagesShowCommandTest.php')
4547
)
4648
->setCacheFile('.php-cs-fixer.cache')
4749
;

CHANGELOG-5.4.md

Lines changed: 310 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Installation
1717
Sponsor
1818
-------
1919

20-
Symfony 5.3 is [backed][27] by [JoliCode][28].
20+
Symfony 5.4 is [backed][27] by [Private Packagist][28].
2121

22-
JoliCode is a team of passionate developers and open-source lovers, with a
23-
strong expertise in PHP & Symfony technologies. They can help you build your
24-
projects using state-of-the-art practices.
22+
Private Packagist is a fast, reliable, and secure Composer repository for your
23+
private packages. It mirrors all your open-source dependencies for better
24+
availability and monitors them for security vulnerabilities.
2525

2626
Help Symfony by [sponsoring][29] its development!
2727

@@ -86,5 +86,5 @@ and supported by [Symfony contributors][19].
8686
[25]: https://symfony.com/doc/current/contributing/code_of_conduct/care_team.html
8787
[26]: https://symfony.com/book
8888
[27]: https://symfony.com/backers
89-
[28]: https://jolicode.com/
89+
[28]: https://packagist.com/
9090
[29]: https://symfony.com/sponsor

UPGRADE-5.4.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
UPGRADE FROM 5.3 to 5.4
2+
=======================
3+
4+
Cache
5+
-----
6+
7+
* Deprecate `DoctrineProvider` and `DoctrineAdapter` because these classes have been added to the `doctrine/cache` package
8+
* Deprecate usage of `PdoAdapter` with a `Doctrine\DBAL\Connection` or a DBAL URL. Use the new `DoctrineDbalAdapter` instead
9+
10+
Console
11+
-------
12+
13+
* Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement
14+
15+
DoctrineBridge
16+
--------------
17+
18+
* Add argument `$bundleDir` to `AbstractDoctrineExtension::getMappingDriverBundleConfigDefaults()`
19+
* Add argument `$bundleDir` to `AbstractDoctrineExtension::getMappingResourceConfigDirectory()`
20+
21+
Finder
22+
------
23+
24+
* Deprecate `Comparator::setTarget()` and `Comparator::setOperator()`
25+
* Add a constructor to `Comparator` that allows setting target and operator
26+
27+
Form
28+
------
29+
30+
* Deprecate calling `FormErrorIterator::children()` if the current element is not iterable.
31+
32+
FrameworkBundle
33+
---------------
34+
35+
* Deprecate the `framework.translator.enabled_locales` config option, use `framework.enabled_locales` instead
36+
* Deprecate the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
37+
* Deprecate the public `profiler` service to private
38+
* Deprecate `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
39+
* Deprecate the `cache.adapter.doctrine` service: The Doctrine Cache library is deprecated. Either switch to Symfony Cache or use the PSR-6 adapters provided by Doctrine Cache.
40+
* In `framework.cache` configuration, using `cache.adapter.pdo` adapter with a Doctrine DBAL connection is deprecated, use `cache.adapter.doctrine_dbal` instead.
41+
* Deprecate not setting the `framework.messenger.reset_on_message` config option, its default value will change to `true` in 6.0
42+
43+
HttpKernel
44+
----------
45+
46+
* Deprecate `AbstractTestSessionListener::getSession` inject a session in the request instead
47+
48+
HttpFoundation
49+
--------------
50+
51+
* Deprecate passing `null` as `$requestIp` to `IpUtils::checkIp()`, `IpUtils::checkIp4()` or `IpUtils::checkIp6()`, pass an empty string instead.
52+
* Mark `Request::get()` internal, use explicit input sources instead
53+
* Deprecate `upload_progress.*` and `url_rewriter.tags` session options
54+
55+
Lock
56+
----
57+
58+
* Deprecate usage of `PdoStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalStore` instead
59+
* Deprecate usage of `PostgreSqlStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalPostgreSqlStore` instead
60+
61+
Messenger
62+
---------
63+
64+
* Deprecate not setting the `delete_after_ack` config option (or DSN parameter) using the Redis transport,
65+
its default value will change to `true` in 6.0
66+
67+
Monolog
68+
-------
69+
70+
* Deprecate `ResetLoggersWorkerSubscriber` to reset buffered logs in messenger
71+
workers, use `framework.messenger.reset_on_message` option in FrameworkBundle messenger configuration instead.
72+
73+
SecurityBundle
74+
--------------
75+
76+
* Deprecate `FirewallConfig::getListeners()`, use `FirewallConfig::getAuthenticators()` instead
77+
* Deprecate `security.authentication.basic_entry_point` and `security.authentication.retry_entry_point` services, the logic is moved into the
78+
`HttpBasicAuthenticator` and `ChannelListener` respectively
79+
* Deprecate not setting `$authenticatorManagerEnabled` to `true` in `SecurityDataCollector` and `DebugFirewallCommand`
80+
* Deprecate `SecurityFactoryInterface` and `SecurityExtension::addSecurityListenerFactory()` in favor of
81+
`AuthenticatorFactoryInterface` and `SecurityExtension::addAuthenticatorFactory()`
82+
* Add `AuthenticatorFactoryInterface::getPriority()` which replaces `SecurityFactoryInterface::getPosition()`.
83+
Previous positions are mapped to the following priorities:
84+
85+
| Position | Constant | Priority |
86+
| ----------- | ----------------------------------------------------- | -------- |
87+
| pre_auth | `RemoteUserFactory::PRIORITY`/`X509Factory::PRIORITY` | -10 |
88+
| form | `FormLoginFactory::PRIORITY` | -30 |
89+
| http | `HttpBasicFactory::PRIORITY` | -50 |
90+
| remember_me | `RememberMeFactory::PRIORITY` | -60 |
91+
| anonymous | n/a | -70 |
92+
93+
* Deprecate passing an array of arrays as 1st argument to `MainConfiguration`, pass a sorted flat array of
94+
factories instead.
95+
* Deprecate the `always_authenticate_before_granting` option
96+
97+
Security
98+
--------
99+
100+
* Deprecate `AuthenticationEvents::AUTHENTICATION_FAILURE`, use the `LoginFailureEvent` instead
101+
* Deprecate the `$authenticationEntryPoint` argument of `ChannelListener`, and add `$httpPort` and `$httpsPort` arguments
102+
* Deprecate `RetryAuthenticationEntryPoint`, this code is now inlined in the `ChannelListener`
103+
* Deprecate `FormAuthenticationEntryPoint` and `BasicAuthenticationEntryPoint`, in the new system the `FormLoginAuthenticator`
104+
and `HttpBasicAuthenticator` should be used instead
105+
* Deprecate `AbstractRememberMeServices`, `PersistentTokenBasedRememberMeServices`, `RememberMeServicesInterface`,
106+
`TokenBasedRememberMeServices`, use the remember me handler alternatives instead
107+
* Deprecate `AnonymousToken`, as the related authenticator was deprecated in 5.3
108+
* Deprecate `Token::getCredentials()`, tokens should no longer contain credentials (as they represent authenticated sessions)
109+
* Deprecate not returning an `UserInterface` from `Token::getUser()`
110+
* Deprecate `AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY` and `AuthenticatedVoter::IS_ANONYMOUS`,
111+
use `AuthenticatedVoter::PUBLIC_ACCESS` instead.
112+
113+
Before:
114+
```yaml
115+
# config/packages/security.yaml
116+
security:
117+
# ...
118+
access_control:
119+
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
120+
```
121+
122+
After:
123+
```yaml
124+
# config/packages/security.yaml
125+
security:
126+
# ...
127+
access_control:
128+
- { path: ^/login, roles: PUBLIC_ACCESS }
129+
```
130+
131+
* Deprecate `AuthenticationTrustResolverInterface::isAnonymous()` and the `is_anonymous()` expression function
132+
as anonymous no longer exists in version 6, use the `isFullFledged()` or the new `isAuthenticated()` instead
133+
if you want to check if the request is (fully) authenticated.
134+
* Deprecate the `$authManager` argument of `AccessListener`, the argument will be removed
135+
* Deprecate the `$authenticationManager` argument of the `AuthorizationChecker` constructor, the argument will be removed
136+
* Deprecate setting the `$alwaysAuthenticate` argument to `true` and not setting the
137+
`$exceptionOnNoToken argument to `false` of `AuthorizationChecker` (this is the default
138+
behavior when using `enable_authenticator_manager: true`)
139+
* Deprecate not setting the `$exceptionOnNoToken` argument of `AccessListener` to `false`
140+
(this is the default behavior when using `enable_authenticator_manager: true`)
141+
* Deprecate `TokenInterface:isAuthenticated()` and `setAuthenticated()` methods,
142+
return `null` from `getUser()` instead when a token is not authenticated
143+
* Deprecate `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead
144+
* Deprecate `CookieClearingLogoutHandler`, `SessionLogoutHandler` and `CsrfTokenClearingLogoutHandler`.
145+
Use `CookieClearingLogoutListener`, `SessionLogoutListener` and `CsrfTokenClearingLogoutListener` instead
146+
* Deprecate `AuthenticatorInterface::createAuthenticatedToken()`, use `AuthenticatorInterface::createToken()` instead
147+
* Deprecate `PassportInterface`, `UserPassportInterface` and `PassportTrait`, use `Passport` instead.
148+
As such, the return type declaration of `AuthenticatorInterface::authenticate()` will change to `Passport` in 6.0
149+
* Deprecate not configuring explicitly a provider for custom_authenticators when there is more than one registered provider
150+
151+
Before:
152+
```php
153+
class MyAuthenticator implements AuthenticatorInterface
154+
{
155+
public function authenticate(Request $request): PassportInterface
156+
{
157+
}
158+
}
159+
```
160+
161+
After:
162+
```php
163+
class MyAuthenticator implements AuthenticatorInterface
164+
{
165+
public function authenticate(Request $request): Passport
166+
{
167+
}
168+
}
169+
```
170+
* Deprecate passing the strategy as string to `AccessDecisionManager`,
171+
pass an instance of `AccessDecisionStrategyInterface` instead
172+
* Flag `AccessDecisionManager` as `@final`
173+
* Deprecate passing `$credentials` to `PreAuthenticatedToken`,
174+
`SwitchUserToken` and `UsernamePasswordToken`:
175+
176+
Before:
177+
```php
178+
$token = new UsernamePasswordToken($user, $credentials, $firewallName, $roles);
179+
$token = new PreAuthenticatedToken($user, $credentials, $firewallName, $roles);
180+
$token = new SwitchUserToken($user, $credentials, $firewallName, $roles, $originalToken);
181+
```
182+
183+
After:
184+
```php
185+
$token = new UsernamePasswordToken($user, $firewallName, $roles);
186+
$token = new PreAuthenticatedToken($user, $firewallName, $roles);
187+
$token = new SwitchUserToken($user, $firewallName, $roles, $originalToken);
188+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy