Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f78bc07

Browse filesBrowse files
committed
Rebase for 7.1
2 parents 068a117 + 3f2ed0f commit f78bc07
Copy full SHA for f78bc07

File tree

5,659 files changed

+189361
-135729
lines changed
Filter options

Some content is hidden

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

5,659 files changed

+189361
-135729
lines changed

‎.appveyor.yml

Copy file name to clipboardExpand all lines: .appveyor.yml
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ init:
1313

1414
install:
1515
- mkdir c:\php && cd c:\php
16-
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-8.1.0-Win32-vs16-x86.zip
17-
- 7z x php-8.1.0-Win32-vs16-x86.zip -y >nul
16+
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-8.2.0-Win32-vs16-x86.zip
17+
- 7z x php-8.2.0-Win32-vs16-x86.zip -y >nul
1818
- cd ext
19-
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.21-8.1-ts-vs16-x86.zip
20-
- 7z x php_apcu-5.1.21-8.1-ts-vs16-x86.zip -y >nul
21-
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_redis-5.3.7-8.1-ts-vs16-x86.zip
22-
- 7z x php_redis-5.3.7-8.1-ts-vs16-x86.zip -y >nul
19+
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.22-8.2-ts-vs16-x86.zip
20+
- 7z x php_apcu-5.1.22-8.2-ts-vs16-x86.zip -y >nul
21+
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_redis-6.0.0-dev-8.2-ts-vs16-x86.zip
22+
- 7z x php_redis-6.0.0-dev-8.2-ts-vs16-x86.zip -y >nul
2323
- cd ..
2424
- copy /Y php.ini-development php.ini-min
2525
- echo memory_limit=-1 >> php.ini-min
2626
- echo serialize_precision=-1 >> php.ini-min
2727
- echo max_execution_time=1200 >> php.ini-min
28-
- echo post_max_size=4G >> php.ini-min
29-
- echo upload_max_filesize=4G >> php.ini-min
28+
- echo post_max_size=2047M >> php.ini-min
29+
- echo upload_max_filesize=2047M >> php.ini-min
3030
- echo date.timezone="America/Los_Angeles" >> php.ini-min
3131
- echo extension_dir=ext >> php.ini-min
3232
- echo extension=php_xsl.dll >> php.ini-min
@@ -35,6 +35,7 @@ install:
3535
- echo opcache.enable_cli=1 >> php.ini-max
3636
- echo extension=php_openssl.dll >> php.ini-max
3737
- echo extension=php_apcu.dll >> php.ini-max
38+
- echo extension=php_igbinary.dll >> php.ini-max
3839
- echo extension=php_redis.dll >> php.ini-max
3940
- echo apc.enable_cli=1 >> php.ini-max
4041
- echo extension=php_intl.dll >> php.ini-max

‎.git-blame-ignore-revs

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
2+
f4118e110a46de3ffb799e7d79bf15128d1646ea
3+
9519b54417c09c49496a4a6be238e63be9a73465
4+
ae0a783425b80b78376488619bf9106e69193fa4
5+
9c1e36257c4df0929179462d6b2bdd00453ac8aa
6+
6ae74d38e3d20d0ffcc66c7c3d28767fab76bdfb

‎.gitattributes

Copy file name to clipboardExpand all lines: .gitattributes
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
/src/Symfony/Component/Messenger/Bridge export-ignore
55
/src/Symfony/Component/Notifier/Bridge export-ignore
66
/src/Symfony/Component/Runtime export-ignore
7+
/src/Symfony/Component/Translation/Bridge export-ignore
8+
/src/Symfony/Component/Emoji/Resources/data/* linguist-generated=true
9+
/src/Symfony/Component/Intl/Resources/data/*/* linguist-generated=true

‎.github/PULL_REQUEST_TEMPLATE.md

Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 6.4 for features / 5.4, or 6.3 for bug fixes <!-- see below -->
3+
| Branch? | 7.1 for features / 5.4, 6.4, or 7.0 for bug fixes <!-- see below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
66
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
7-
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
7+
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
88
| License | MIT
9-
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
9+
1010
<!--
11-
Replace this notice by a short README for your feature/bugfix.
11+
Replace this notice by a description of your feature/bugfix.
1212
This will help reviewers and should be a good start for the documentation.
1313
1414
Additionally (see https://symfony.com/releases):

‎.github/expected-missing-return-types.diff

Copy file name to clipboardExpand all lines: .github/expected-missing-return-types.diff
+370-14,532Lines changed: 370 additions & 14532 deletions
Large diffs are not rendered by default.

‎.github/get-modified-packages.php

Copy file name to clipboardExpand all lines: .github/get-modified-packages.php
+13-27Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,15 @@
1919

2020
function getPackageType(string $packageDir): string
2121
{
22-
if (preg_match('@Symfony/Bridge/@', $packageDir)) {
23-
return 'bridge';
24-
}
25-
26-
if (preg_match('@Symfony/Bundle/@', $packageDir)) {
27-
return 'bundle';
28-
}
29-
30-
if (preg_match('@Symfony/Component/[^/]+/Bridge/@', $packageDir)) {
31-
return 'component_bridge';
32-
}
33-
34-
if (preg_match('@Symfony/Component/@', $packageDir)) {
35-
return 'component';
36-
}
37-
38-
if (preg_match('@Symfony/Contracts/@', $packageDir)) {
39-
return 'contract';
40-
}
41-
42-
if (preg_match('@Symfony/Contracts$@', $packageDir)) {
43-
return 'contracts';
44-
}
45-
46-
throw new \LogicException();
22+
return match (true) {
23+
str_contains($packageDir, 'Symfony/Bridge/') => 'bridge',
24+
str_contains($packageDir, 'Symfony/Bundle/') => 'bundle',
25+
preg_match('@Symfony/Component/[^/]+/Bridge/@', $packageDir) => 'component_bridge',
26+
str_contains($packageDir, 'Symfony/Component/') => 'component',
27+
str_contains($packageDir, 'Symfony/Contracts/') => 'contract',
28+
str_ends_with($packageDir, 'Symfony/Contracts') => 'contracts',
29+
default => throw new \LogicException(),
30+
};
4731
}
4832

4933
$newPackage = [];
@@ -66,8 +50,10 @@ function getPackageType(string $packageDir): string
6650

6751
$output = [];
6852
foreach ($modifiedPackages as $directory => $bool) {
69-
$name = json_decode(file_get_contents($directory.'/composer.json'), true)['name'] ?? 'unknown';
70-
$output[] = ['name' => $name, 'directory' => $directory, 'new' => $newPackage[$directory] ?? false, 'type' => getPackageType($directory)];
53+
$composerData = json_decode(file_get_contents($directory.'/composer.json'), true);
54+
$name = $composerData['name'] ?? 'unknown';
55+
$requiresDeprecationContracts = isset($composerData['require']['symfony/deprecation-contracts']);
56+
$output[] = ['name' => $name, 'directory' => $directory, 'new' => $newPackage[$directory] ?? false, 'type' => getPackageType($directory), 'requires_deprecation_contracts' => $requiresDeprecationContracts];
7157
}
7258

7359
echo json_encode($output);

‎.github/patch-types.php

Copy file name to clipboardExpand all lines: .github/patch-types.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
}
2424
// no break;
2525
case false !== strpos($file, '/vendor/'):
26+
case false !== strpos($file, '/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php'):
27+
case false !== strpos($file, '/src/Symfony/Bridge/Doctrine/Middleware/Debug/'):
28+
case false !== strpos($file, '/src/Symfony/Bridge/Doctrine/Tests/Fixtures/LegacyQueryMock.php'):
2629
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
27-
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ContainerAwareController.php'):
2830
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
2931
case false !== strpos($file, '/src/Symfony/Component/Cache/Tests/Fixtures/DriverWrapper.php'):
3032
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php'):

‎.github/sync-translations.php

Copy file name to clipboard
+129Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
3+
// This script should be run after adding a new message to translate.
4+
// It will ensure that all messages in "*.en.xlf" files are propagated to all languages.
5+
// The resulting diff should then be submitted as a PR on the lowest maintained branch,
6+
// possibly after using GPT to translate all the targets it contains
7+
// (state="needs-review-translation" should then be used on corresponding target tags.)
8+
9+
use Symfony\Component\Finder\Finder;
10+
use Symfony\Component\Translation\Loader\XliffFileLoader;
11+
use Symfony\Component\Translation\MessageCatalogue;
12+
13+
require __DIR__.'/../vendor/autoload.php';
14+
15+
function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, string $domain, ?\DOMElement $header = null)
16+
{
17+
$dom = new \DOMDocument('1.0', 'utf-8');
18+
$dom->formatOutput = true;
19+
20+
$xliff = $dom->appendChild($dom->createElement('xliff'));
21+
$xliff->setAttribute('version', '1.2');
22+
$xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2');
23+
24+
$xliffFile = $xliff->appendChild($dom->createElement('file'));
25+
$xliffFile->setAttribute('source-language', str_replace('_', '-', $defaultLocale));
26+
$xliffFile->setAttribute('target-language', 'no' === $messages->getLocale() ? 'nb' : str_replace('_', '-', $messages->getLocale()));
27+
$xliffFile->setAttribute('datatype', 'plaintext');
28+
$xliffFile->setAttribute('original', 'file.ext');
29+
30+
if (null !== $header) {
31+
mergeDom($dom, $xliffFile, $header);
32+
}
33+
34+
$xliffBody = $xliffFile->appendChild($dom->createElement('body'));
35+
foreach ($messages->all($domain) as $source => $target) {
36+
$translation = $dom->createElement('trans-unit');
37+
$metadata = $messages->getMetadata($source, $domain);
38+
39+
$translation->setAttribute('id', $metadata['id']);
40+
if (isset($metadata['resname'])) {
41+
$translation->setAttribute('resname', $metadata['resname']);
42+
}
43+
44+
$s = $translation->appendChild($dom->createElement('source'));
45+
$s->appendChild($dom->createTextNode($source));
46+
47+
$text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target);
48+
49+
$targetElement = $dom->createElement('target');
50+
51+
if ('en' !== $messages->getLocale() && $target === $source && 'Error' !== $source) {
52+
$targetElement->setAttribute('state', 'needs-translation');
53+
}
54+
if (isset($metadata['target-attributes'])) {
55+
foreach ($metadata['target-attributes'] as $key => $value) {
56+
$targetElement->setAttribute($key, $value);
57+
}
58+
}
59+
60+
$t = $translation->appendChild($targetElement);
61+
$t->appendChild($text);
62+
63+
$xliffBody->appendChild($translation);
64+
}
65+
66+
return preg_replace('/^ +/m', '$0$0', $dom->saveXML());
67+
}
68+
69+
function mergeDom(\DOMDocument $dom, \DOMNode $tree, \DOMNode $input)
70+
{
71+
$new = $dom->createElement($input->tagName);
72+
foreach ($input->attributes as $key => $value) {
73+
$new->setAttribute($key, $value);
74+
}
75+
$tree->appendChild($new);
76+
foreach ($input->childNodes as $child) {
77+
if ($child instanceof \DOMText) {
78+
$new->appendChild($dom->createTextNode(str_replace(' ', ' ', $child->textContent)));
79+
} elseif ($child instanceof \DOMNode) {
80+
mergeDom($dom, $new, $child);
81+
} else {
82+
// We just need to update our script to handle this node types
83+
throw new \LogicException('Unsupported node type: '.get_class($child));
84+
}
85+
}
86+
}
87+
88+
foreach (['Security/Core' => 'security', 'Form' => 'validators', 'Validator' => 'validators'] as $component => $domain) {
89+
$dir = __DIR__.'/../src/Symfony/Component/'.$component.'/Resources/translations';
90+
91+
$enCatalogue = (new XliffFileLoader())->load($dir.'/'.$domain.'.en.xlf', 'en', $domain);
92+
file_put_contents($dir.'/'.$domain.'.en.xlf', dumpXliff1('en', $enCatalogue, $domain));
93+
94+
$finder = new Finder();
95+
96+
foreach ($finder->files()->in($dir)->name('*.xlf') as $file) {
97+
$locale = substr($file->getBasename(), 1 + strlen($domain), -4);
98+
99+
if ('en' === $locale) {
100+
continue;
101+
}
102+
103+
$catalogue = (new XliffFileLoader())->load($file, $locale, $domain);
104+
$localeCatalogue = new MessageCatalogue($locale);
105+
106+
foreach ($enCatalogue->all($domain) as $resname => $source) {
107+
$metadata = [];
108+
if ($catalogue->defines($resname, $domain)) {
109+
$translation = $catalogue->get($resname, $domain);
110+
$metadata = $catalogue->getMetadata($resname, $domain);
111+
}
112+
$metadata['id'] = $enCatalogue->getMetadata($resname, $domain)['id'];
113+
if ($resname !== $source) {
114+
$metadata['resname'] = $resname;
115+
}
116+
$localeCatalogue->set($source, $translation, $domain);
117+
$localeCatalogue->setMetadata($source, $metadata, $domain);
118+
}
119+
120+
$inputDom = new \DOMDocument();
121+
$inputDom->loadXML(file_get_contents($file->getRealPath()));
122+
$header = null;
123+
if (1 === $inputDom->getElementsByTagName('header')->count()) {
124+
$header = $inputDom->getElementsByTagName('header')->item(0);
125+
}
126+
127+
file_put_contents($file, dumpXliff1('en', $localeCatalogue, $domain, $header));
128+
}
129+
}

‎.github/workflows/integration-tests.yml

Copy file name to clipboardExpand all lines: .github/workflows/integration-tests.yml
+45-16Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
strategy:
2525
matrix:
26-
php: ['8.1']
26+
php: ['8.2']
2727
fail-fast: false
2828

2929
services:
@@ -48,6 +48,12 @@ jobs:
4848
image: redis:6.2.8
4949
ports:
5050
- 16379:6379
51+
redis-authenticated:
52+
image: redis:6.2.8
53+
ports:
54+
- 16380:6379
55+
env:
56+
REDIS_ARGS: "--requirepass p@ssword"
5157
redis-cluster:
5258
image: grokzen/redis-cluster:6.2.8
5359
ports:
@@ -89,9 +95,9 @@ jobs:
8995
- 8094:8094
9096
- 11210:11210
9197
sqs:
92-
image: asyncaws/testing-sqs
98+
image: localstack/localstack:3.0.2
9399
ports:
94-
- 9494:9494
100+
- 4566:4566
95101
zookeeper:
96102
image: wurstmeister/zookeeper:3.4.6
97103
kafka:
@@ -104,10 +110,20 @@ jobs:
104110
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
105111
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
106112
KAFKA_ADVERTISED_PORT: 9092
113+
frankenphp:
114+
image: dunglas/frankenphp:1.1.0
115+
ports:
116+
- 80:80
117+
volumes:
118+
- ${{ github.workspace }}:/symfony
119+
env:
120+
SERVER_NAME: 'http://localhost'
121+
CADDY_SERVER_EXTRA_DIRECTIVES: |
122+
root * /symfony/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/
107123
108124
steps:
109125
- name: Checkout
110-
uses: actions/checkout@v3
126+
uses: actions/checkout@v4
111127

112128
- name: Install system dependencies
113129
run: |
@@ -124,12 +140,20 @@ jobs:
124140
sudo service redis-server restart
125141
echo "::endgroup::"
126142
143+
- name: Install pgbouncer
144+
run: |
145+
sudo apt-get install -y pgbouncer
146+
sudo cp src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Fixtures/pgbouncer/pgbouncer.ini /etc/pgbouncer/pgbouncer.ini
147+
sudo cp src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Fixtures/pgbouncer/userlist.txt /etc/pgbouncer/userlist.txt
148+
sudo service pgbouncer restart
149+
sudo su - postgres -c "PGPASSWORD=password psql -Atq -h localhost -p 5432 -U postgres -d postgres -c \"SELECT usename, passwd FROM pg_shadow\""
150+
127151
- name: Configure Couchbase
128152
run: |
129-
curl -s -u 'username=Administrator&password=111111' -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex%2Cfts'
130-
curl -s -X POST http://localhost:8091/settings/web -d 'username=Administrator&password=111111&port=SAME'
131-
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
132-
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
153+
curl -s -u 'username=Administrator&password=111111@' -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex%2Cfts'
154+
curl -s -X POST http://localhost:8091/settings/web -d 'username=Administrator&password=111111%40&port=SAME'
155+
curl -s -u Administrator:111111@ -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
156+
curl -s -u Administrator:111111@ -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
133157
134158
- name: Setup PHP
135159
uses: shivammathur/setup-php@v2
@@ -159,7 +183,6 @@ jobs:
159183
echo COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION >> $GITHUB_ENV
160184
161185
echo "::group::composer update"
162-
composer require --dev --no-update mongodb/mongodb
163186
composer update --no-progress --ansi
164187
echo "::endgroup::"
165188
@@ -171,29 +194,35 @@ jobs:
171194
run: ./phpunit --group integration -v
172195
env:
173196
REDIS_HOST: 'localhost:16379'
197+
REDIS_AUTHENTICATED_HOST: 'localhost:16380'
174198
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
175-
REDIS_SENTINEL_HOSTS: 'localhost:26379 localhost:26379 localhost:26379'
199+
REDIS_SENTINEL_HOSTS: 'unreachable-host:26379 localhost:26379 localhost:26379'
176200
REDIS_SENTINEL_SERVICE: redis_sentinel
177201
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
178202
MESSENGER_AMQP_DSN: amqp://localhost/%2f/messages
179-
MESSENGER_SQS_DSN: "sqs://localhost:9494/messages?sslmode=disable&poll_timeout=0.01"
180-
MESSENGER_SQS_FIFO_QUEUE_DSN: "sqs://localhost:9494/messages.fifo?sslmode=disable&poll_timeout=0.01"
203+
MESSENGER_SQS_DSN: "sqs://localhost:4566/messages?sslmode=disable&poll_timeout=0.01"
204+
MESSENGER_SQS_FIFO_QUEUE_DSN: "sqs://localhost:4566/messages.fifo?sslmode=disable&poll_timeout=0.01"
181205
KAFKA_BROKER: 127.0.0.1:9092
182206
POSTGRES_HOST: localhost
207+
PGBOUNCER_HOST: localhost:6432
183208

184209
#- name: Run HTTP push tests
185-
# if: matrix.php == '8.1'
210+
# if: matrix.php == '8.2'
186211
# run: |
187212
# [ -d .phpunit ] && mv .phpunit .phpunit.bak
188213
# wget -q https://github.com/symfony/binary-utils/releases/download/v0.1/vulcain_0.1.3_Linux_x86_64.tar.gz -O - | tar xz && mv vulcain /usr/local/bin
189214
# docker run --rm -e COMPOSER_ROOT_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v $(which vulcain):/usr/local/bin/vulcain -w /app php:8.1-alpine ./phpunit src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
190215
# sudo rm -rf .phpunit
191216
# [ -d .phpunit.bak ] && mv .phpunit.bak .phpunit
192217

193-
- uses: marceloprado/has-changed-path@v1
218+
- name: Check for changes in translation files
194219
id: changed-translation-files
195-
with:
196-
paths: src/**/Resources/translations/*.xlf
220+
run: |
221+
if git diff --quiet HEAD~1 HEAD -- 'src/**/Resources/translations/*.xlf'; then
222+
echo "{changed}={true}" >> $GITHUB_OUTPUT
223+
else
224+
echo "{changed}={false}" >> $GITHUB_OUTPUT
225+
fi
197226
198227
- name: Check Translation Status
199228
if: steps.changed-translation-files.outputs.changed == 'true'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.