8000 Merge branch 'symfony:7.1' into fix_52782 · symfony/symfony@d33e181 · GitHub
[go: up one dir, main page]

Skip to content

Commit d33e181

Browse files
authored
Merge branch 'symfony:7.1' into fix_52782
2 parents c681fe2 + 862c6fb commit d33e181

File tree

164 files changed

+1464
-682
lines changed

Some content is hidden

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

164 files changed

+1464
-682
lines changed

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ jobs:
132132
133133
- name: Configure Couchbase
134134
run: |
135-
curl -s -u 'username=Administrator&password=111111' -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex%2Cfts'
136-
curl -s -X POST http://localhost:8091/settings/web -d 'username=Administrator&password=111111&port=SAME'
137-
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
138-
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
135+
curl -s -u 'username=Administrator&password=111111@' -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex%2Cfts'
136+
curl -s -X POST http://localhost:8091/settings/web -d 'username=Administrator&password=111111%40&port=SAME'
137+
curl -s -u Administrator:111111@ -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
138+
curl -s -u Administrator:111111@ -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
139139
140140
- name: Setup PHP
141141
uses: shivammathur/setup-php@v2

UPGRADE-7.1.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,31 @@ Cache
66

77
* Deprecate `CouchbaseBucketAdapter`, use `CouchbaseCollectionAdapter` instead
88

9+
FrameworkBundle
10+
---------------
11+
12+
* Mark classes `ConfigBuilderCacheWarmer`, `Router`, `SerializerCacheWarmer`, `TranslationsCacheWarmer`, `Translator` and `ValidatorCacheWarmer` as `final`
13+
914
Messenger
1015
---------
1116

1217
* Make `#[AsMessageHandler]` final
1318

19+
SecurityBundle
20+
--------------
21+
22+
* Mark class `ExpressionCacheWarmer` as `final`
23+
24+
Translation
25+
-----------
26+
27+
* Mark class `DataCollectorTranslator` as `final`
28+
29+
TwigBundle
30+
----------
31+
32+
* Mark class `TemplateCacheWarmer` as `final`
33+
1434
Workflow
1535
--------
1636

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<env name="ZOOKEEPER_HOST" value="localhost" />
2626
<env name="COUCHBASE_HOST" value="localhost" />
2727
<env name="COUCHBASE_USER" value="Administrator" />
28-
<env name="COUCHBASE_PASS" value="111111" />
28+
<env name="COUCHBASE_PASS" value="111111%40" />
2929
</php>
3030

3131
<testsuites>

src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* since this information is necessary to build the proxies in the first place.
2222
*
2323
* @author Benjamin Eberlei <kontakt@beberlei.de>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class ProxyCacheWarmer implements CacheWarmerInterface
2628
{

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList;
1313

1414
use Doctrine\DBAL\ArrayParameterType;
15-
use Doctrine\DBAL\Result;
1615
use Doctrine\DBAL\Types\GuidType;
1716
use Doctrine\DBAL\Types\Type;
1817
use Doctrine\ORM\AbstractQuery;

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function testAllConfiguredFieldsAreCheckedOfBeingMappedByDoctrineWithIgno
292292
{
293293
$entity1 = new SingleIntIdEntity(1, null);
294294

295-
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
295+
$this->expectException(ConstraintDefinitionException::class);
296296
$this->validator->validate($entity1, $constraint);
297297
}
298298

src/Symfony/Bridge/Monolog/Tests/Handler/MailerHandlerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Monolog\Formatter\HtmlFormatter;
1515
use Monolog\Formatter\LineFormatter;
1616
use Monolog\Level;
17-
use Monolog\Logger;
1817
use Monolog\LogRecord;
1918
use PHPUnit\Framework\MockObject\MockObject;
2019
use PHPUnit\Framework\TestCase;

src/Symfony/Bridge/PsrHttpMessage/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "symfony-bridge",
44
"description": "PSR HTTP message bridge",
55
"keywords": ["http", "psr-7", "psr-17", "http-message"],
6-
"homepage": "http://symfony.com",
6+
"homepage": "https://symfony.com",
77
"license": "MIT",
88
"authors": [
99
{
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"name": "Symfony Community",
15-
"homepage": "http://symfony.com/contributors"
15+
"homepage": "https://symfony.com/contributors"
1616
}
1717
],
1818
"require": {

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
7.1
55
---
66

7+
* Mark classes `ConfigBuilderCacheWarmer`, `Router`, `SerializerCacheWarmer`, `TranslationsCacheWarmer`, `Translator` and `ValidatorCacheWarmer` as `final`
78
* Move the Router `cache_dir` to `kernel.build_dir`
89
* Deprecate the `router.cache_dir` config option
910
* Add `rate_limiter` tags to rate limiter services

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* Generate all config builders.
2626
*
2727
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
28+
*
29+
* @final since Symfony 7.1
2830
*/
2931
class ConfigBuilderCacheWarmer implements CacheWarmerInterface
3032
{

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* Warms up XML and YAML serializer metadata.
2424
*
2525
* @author Titouan Galopin <galopintitouan@gmail.com>
26+
*
27+
* @final since Symfony 7.1
2628
*/
2729
class SerializerCacheWarmer extends AbstractPhpFileCacheWarmer
2830
{

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Generates the catalogues for translations.
2222
*
2323
* @author Xavier Leune <xavier.leune@gmail.com>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2628
{

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* Warms up XML and YAML validator metadata.
2525
*
2626
* @author Titouan Galopin <galopintitouan@gmail.com>
27+
*
28+
* @final since Symfony 7.1
2729
*/
2830
class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer
2931
{

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ private function isNfs(string $dir): bool
200200

201201
if (null === $mounts) {
202202
$mounts = [];
203-
if ('/' === \DIRECTORY_SEPARATOR && $files = @file('/proc/mounts')) {
203+
if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) {
204204
foreach ($files as $mount) {
205205
$mount = \array_slice(explode(' ', $mount), 1, -3);
206206
if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) {

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function all(string $namespace = null): array
158158

159159
public function getLongVersion(): string
160160
{
161-
return parent::getLongVersion().sprintf(' (env: <comment>%s</>, debug: <comment>%s</>) <bg=#0057B7;fg=#FFDD00>#StandWith</><bg=#FFDD00;fg=#0057B7>Ukraine</> <href=https://sf.to/ukraine>https://sf.to/ukraine</>', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
161+
return parent::getLongVersion().sprintf(' (env: <comment>%s</>, debug: <comment>%s</>)', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
162162
}
163163

164164
public function add(Command $command): ?Command

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ private function getCallableData(mixed $callable): array
393393
$data['type'] = 'closure';
394394

395395
$r = new \ReflectionFunction($callable);
396-
if (str_contains($r->name, '{closure}')) {
396+
if ($r->isAnonymous()) {
397397
return $data;
398398
}
399399
$data['name'] = $r->name;

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ protected function describeCallable(mixed $callable, array $options = []): void
403403
$string .= "\n- Type: `closure`";
404404

405405
$r = new \ReflectionFunction($callable);
406-
if (str_contains($r->name, '{closure}')) {
406+
if ($r->isAnonymous()) {
407407
$this->write($string."\n");
408408

409409
return;

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ private function formatCallable(mixed $callable): string
649649

650650
if ($callable instanceof \Closure) {
651651
$r = new \ReflectionFunction($callable);
652-
if (str_contains($r->name, '{closure}')) {
652+
if ($r->isAnonymous()) {
653653
return 'Closure()';
654654
}
655655
if ($class = $r->getClosureCalledClass()) {

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ private function getCallableDocument(mixed $callable): \DOMDocument
581581
$callableXML->setAttribute('type', 'closure');
582582

583583
$r = new \ReflectionFunction($callable);
584-
if (str_contains($r->name, '{closure}')) {
584+
if ($r->isAnonymous()) {
585585
return $dom;
586586
}
587587
$callableXML->setAttribute('name', $r->name);

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected function generateUrl(string $route, array $parameters = [], int $refer
108108
/**
109109
* Forwards the request to another controller.
110110
*
111-
* @param string $controller The controller name (a string like Bundle\BlogBundle\Controller\PostController::indexAction)
111+
* @param string $controller The controller name (a string like "App\Controller\PostController::index" or "App\Controller\PostController" if it is invokable)
112112
*/
113113
protected function forward(string $controller, array $path = [], array $query = []): Response
114114
{

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,6 +2745,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
27452745
NotifierBridge\RocketChat\RocketChatTransportFactory::class => 'notifier.transport_factory.rocket-chat',
27462746
NotifierBridge\Sendberry\SendberryTransportFactory::class => 'notifier.transport_factory.sendberry',
27472747
NotifierBridge\SimpleTextin\SimpleTextinTransportFactory::class => 'notifier.transport_factory.simple-textin',
2748+
NotifierBridge\Sevenio\SevenIoTransportFactory::class => 'notifier.transport_factory.sevenio',
2748< 10000 /td>2749
NotifierBridge\Sinch\SinchTransportFactory::class => 'notifier.transport_factory.sinch',
27492750
NotifierBridge\Slack\SlackTransportFactory::class => 'notifier.transport_factory.slack',
27502751
NotifierBridge\Sms77\Sms77TransportFactory::class => 'notifier.transport_factory.sms77',
@@ -2754,6 +2755,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
27542755
NotifierBridge\Smsc\SmscTransportFactory::class => 'notifier.transport_factory.smsc',
27552756
NotifierBridge\SmsFactor\SmsFactorTransportFactory::class => 'notifier.transport_factory.sms-factor',
27562757
NotifierBridge\Smsmode\SmsmodeTransportFactory::class => 'notifier.transport_factory.smsmode',
2758+
NotifierBridge\SmsSluzba\SmsSluzbaTransportFactory::class => 'notifier.transport_factory.sms-sluzba',
27572759
NotifierBridge\SpotHit\SpotHitTransportFactory::class => 'notifier.transport_factory.spot-hit',
27582760
NotifierBridge\Telegram\TelegramTransportFactory::class => 'notifier.transport_factory.telegram',
27592761
NotifierBridge\Telnyx\TelnyxTransportFactory::class => 'notifier.transport_factory.telnyx',

src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function loadRoutes(LoaderInterface $loader): RouteCollection
214214

215215
if (\is_array($controller) && [0, 1] === array_keys($controller) && $this === $controller[0]) {
216216
$route->setDefault('_controller', ['kernel', $controller[1]]);
217-
} elseif ($controller instanceof \Closure && $this === ($r = new \ReflectionFunction($controller))->getClosureThis() && !str_contains($r->name, '{closure}')) {
217+
} elseif ($controller instanceof \Closure && $this === ($r = new \ReflectionFunction($controller))->getClosureThis() && !$r->isAnonymous()) {
218218
$route->setDefault('_controller', ['kernel', $r->name]);
219219
}
220220
}

src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_transports.php

Lines changed: 28 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -39,73 +39,32 @@
3939
service('http_client')->ignoreOnInvalid(),
4040
service('logger')->ignoreOnInvalid(),
4141
])
42-
->tag('monolog.logger', ['channel' => 'mailer'])
43-
44-
->set('mailer.transport_factory.amazon', SesTransportFactory::class)
45-
->parent('mailer.transport_factory.abstract')
46-
->tag('mailer.transport_factory')
47-
48-
->set('mailer.transport_factory.azure', AzureTransportFactory::class)
49-
->parent('mailer.transport_factory.abstract')
50-
->tag('mailer.transport_factory')
51-
52-
->set('mailer.transport_factory.brevo', BrevoTransportFactory::class)
53-
->parent('mailer.transport_factory.abstract')
54-
->tag('mailer.transport_factory')
55-
56-
->set('mailer.transport_factory.gmail', GmailTransportFactory::class)
57-
->parent('mailer.transport_factory.abstract')
58-
->tag('mailer.transport_factory')
59-
60-
->set('mailer.transport_factory.infobip', InfobipTransportFactory::class)
61-
->parent('mailer.transport_factory.abstract')
62-
->tag('mailer.transport_factory')
63-
64-
->set('mailer.transport_factory.mailersend', MailerSendTransportFactory::class)
65-
->parent('mailer.transport_factory.abstract')
66-
->tag('mailer.transport_factory')
67-
68-
->set('mailer.transport_factory.mailchimp', MandrillTransportFactory::class)
69-
->parent('mailer.transport_factory.abstract')
70-
->tag('mailer.transport_factory')
71-
72-
->set('mailer.transport_factory.mailjet', MailjetTransportFactory::class)
73-
->parent('mailer.transport_factory.abstract')
74-
->tag('mailer.transport_factory')
75-
76-
->set('mailer.transport_factory.mailgun', MailgunTransportFactory::class)
77-
->parent('mailer.transport_factory.abstract')
78-
->tag('mailer.transport_factory')
79-
80-
->set('mailer.transport_factory.mailpace', MailPaceTransportFactory::class)
81-
->parent('mailer.transport_factory.abstract')
82-
->tag('mailer.transport_factory')
83-
84-
->set('mailer.transport_factory.postmark', PostmarkTransportFactory::class)
85-
->parent('mailer.transport_factory.abstract')
86-
->tag('mailer.transport_factory')
87-
88-
->set('mailer.transport_factory.sendgrid', SendgridTransportFactory::class)
89-
->parent('mailer.transport_factory.abstract')
90-
->tag('mailer.transport_factory')
91-
92-
->set('mailer.transport_factory.null', NullTransportFactory::class)
93-
->parent('mailer.transport_factory.abstract')
94-
->tag('mailer.transport_factory')
95-
96-
->set('mailer.transport_factory.scaleway', ScalewayTransportFactory::class)
97-
->parent('mailer.transport_factory.abstract')
98-
->tag('mailer.transport_factory')
99-
100-
->set('mailer.transport_factory.sendmail', SendmailTransportFactory::class)
101-
->parent('mailer.transport_factory.abstract')
102-
->tag('mailer.transport_factory')
103-
104-
->set('mailer.transport_factory.smtp', EsmtpTransportFactory::class)
105-
->parent('mailer.transport_factory.abstract')
106-
->tag('mailer.transport_factory', ['priority' => -100])
107-
108-
->set('mailer.transport_factory.native', NativeTransportFactory::class)
109-
->parent('mailer.transport_factory.abstract')
110-
->tag('mailer.transport_factory');
42+
->tag('monolog.logger', ['channel' => 'mailer']);
43+
44+
$factories = [
45+
'amazon' => SesTransportFactory::class,
46+
'azure' => AzureTransportFactory::class,
47+
'brevo' => BrevoTransportFactory::class,
48+
'gmail' => GmailTransportFactory::class,
49+
'infobip' => InfobipTransportFactory::class,
50+
'mailchimp' => MandrillTransportFactory::class,
51+
'mailersend' => MailerSendTransportFactory::class,
52+
'mailgun' => MailgunTransportFactory::class,
53+
'mailjet' => MailjetTransportFactory::class,
54+
'mailpace' => MailPaceTransportFactory::class,
55+
'native' => NativeTransportFactory::class,
56+
'null' => NullTransportFactory::class,
57+
'postmark' => PostmarkTransportFactory::class,
58+
'scaleway' => ScalewayTransportFactory::class,
59+
'sendgrid' => SendgridTransportFactory::class,
60+
'sendmail' => SendmailTransportFactory::class,
61+
'smtp' => EsmtpTransportFactory::class,
62+
];
63+
64+
foreach ($factories as $name => $class) {
65+
$container->services()
66+
->set('mailer.transport_factory.'.$name, $class)
67+
->parent('mailer.transport_factory.abstract')
68+
->tag('mailer.transport_factory');
69+
}
11170
};

0 commit comments

Comments
 (0)
0