10BC0 Merge branch '5.2' into 5.x · symfony/symfony@fe49ed2 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe49ed2

Browse files
Merge branch '5.2' into 5.x
* 5.2: µCS fix CS fix CS fix [travis] use PHP 8.0 to patch return types and run deps=low Add me as a Notifier code owner Update sl_SI translations Don't trigger deprecation for deprecated aliases pointing to deprecated definitions [HttpFoundation] use atomic writes in MockFileSessionStorage fix typo Make EmailMessage & SmsMessage transport nullable remove unused argument [SecurityBundle] Drop dead check [DI] fix param annotation [SecurityBundle] Remove invalid service definition [Config] Add \Symfony\Component\Config\Loader::load() return type Simplify PHP CS Fixer config Rename normalize param
2 parents 0764380 + 106c693 commit fe49ed2

File tree

58 files changed

+314
-127
lines changed

Some content is hidden

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

58 files changed

+314
-127
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
# Messenger
3232
/src/Symfony/Bridge/Doctrine/Messenger/ @sroze
3333
/src/Symfony/Component/Messenger/ @sroze
34+
# Notifer
35+
/src/Symfony/Component/Notifier/ @OskarStark
3436
# OptionsResolver
3537
/src/Symfony/Component/OptionsResolver/ @yceruto
3638
# PropertyInfo

.github/patch-types.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,25 @@
1313

1414
foreach ($loader->getClassMap() as $class => $file) {
1515
switch (true) {
16-
case false !== strpos(realpath($file), '/vendor/'):
16+
case false !== strpos($file = realpath($file), '/vendor/'):
1717
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
1818
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
1919
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php'):
2020
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadParent.php'):
2121
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/ParseError.php'):
2222
case false !== strpos($file, '/src/Symfony/Component/Debug/Tests/Fixtures/'):
2323
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php'):
24-
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/UnionConstructor.php'):
2524
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php'):
26-
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes_80.php'):
27-
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/uniontype_classes.php'):
25+
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php'):
2826
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ParentNotExists.php'):
2927
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Preload/'):
3028
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
31-
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/WitherStaticReturnType.php'):
3229
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/'):
3330
case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
34-
case false !== strpos($file, '/src/Symfony/Component/HttpKernel/Tests/Fixtures/Controller/AttributeController.php'):
3531
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'):
3632
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'):
37-
case false !== s 10650 trpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php80Dummy.php'):
38-
case false !== strpos($file, '/src/Symfony/Component/Routing/Tests/Fixtures/AttributeFixtures'):
3933
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
40-
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Fixtures/Attributes/'):
41-
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/LotsOfAttributes.php'):
42-
case false !== strpos($file, '/src/Symfony/Component/Validator/Tests/Fixtures/Attribute/'):
43-
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/MyAttribute.php'):
4434
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
45-
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php') && \PHP_VERSION_ID < 70400:
46-
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/RepeatableAttribute.php'):
4735
continue 2;
4836
}
4937

.github/rm-invalid-lowest-lock-files.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
error_reporting(-1);
44
set_error_handler(function ($type, $message, $file, $line) {
5-
if (error_reporting()) {
5+
if (error_reporting() & $type) {
66
throw new \ErrorException($message, 0, $type, $file, $line);
77
}
88
});

.php_cs.dist

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@ if (!file_exists(__DIR__.'/src')) {
66

77
return PhpCsFixer\Config::create()
88
->setRules([
9+
'@PHP71Migration' => true,
10+
'@PHPUnit75Migration:risky' => true,
911
'@Symfony' => true,
1012
'@Symfony:risky' => true,
11-
'@PHPUnit75Migration:risky' => true,
12-
'php_unit_dedicate_assert' => ['target' => '5.6'],
13-
'array_syntax' => ['syntax' => 'short'],
14-
'fopen_flags' => false,
1513
'protected_to_private' => false,
1614
'native_constant_invocation' => true,
17-
'combine_nested_dirname' => true,
1815
'list_syntax' => ['syntax' => 'short'],
19-
'visibility_required' => ['property', 'method', 'const'],
20-
'ternary_to_null_coalescing' => true,
2116
])
2217
->setRiskyAllowed(true)
2318
->setFinder(

.travis.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ env:
2121
matrix:
2222
include:
2323
- php: 7.2
24-
env: php_extra="7.4"
25-
- php: 7.3
26-
env: deps=high
24+
env: php_extra="7.3 8.0"
2725
- php: 7.4
28-
env: deps=low
26+
env: deps=high
2927
- php: 8.0
30-
services: [memcached]
28+
env: deps=low
3129
fast_finish: true
3230

3331
cache:
@@ -71,7 +69,7 @@ before_install:
7169
7270
# tfold is a helper to create folded reports
7371
tfold () {
74-
local title="🐘 $PHP $1 $FLIP"
72+
local title="$PHP $1 $FLIP"
7573
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
7674
shift
7775
local id=$(printf %08x $(( RANDOM * RANDOM )))
@@ -183,6 +181,7 @@ install:
183181
git config --global user.name "Symfony"
184182
185183
export SYMFONY_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*')
184+
SYMFONY_VERSIONS=$(git ls-remote -q --heads);
186185
187186
if [[ ! $deps ]]; then
188187
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit
@@ -202,8 +201,8 @@ install:
202201
10650 - |
203202
# For the feature-branch, when deps=high, the version before it is checked out and tested with the locally patched components
204203
if [[ $deps = high && $TRAVIS_BRANCH = *.x ]]; then
205-
export FLIP='🙃'
206-
export SYMFONY_VERSION=$(git ls-remote -q --heads | grep -o '/[1-9]\.[0-9].*' | tail -n 1 | sed s/.//) &&
204+
export FLIP='^'
205+
export SYMFONY_VERSION=$(echo "$SYMFONY_VERSIONS" | grep -o '/[1-9]\.[0-9].*' | tail -n 1 | sed s/.//) &&
207206
git fetch --depth=2 origin $SYMFONY_VERSION &&
208207
git checkout -m FETCH_HEAD &&
209208
export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
@@ -226,7 +225,7 @@ install:
226225
227226
- |
228227
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
229-
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git ls-remote -q --heads | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1 | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
228+
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(echo "$SYMFONY_VERSIONS" | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1 | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
230229
231230
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
232231
@@ -248,7 +247,7 @@ install:
248247
set -e
249248
export PHP=$1
250249
251-
if [[ $PHP != 7.4* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
250+
if [[ $PHP != 8.0* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
252251
echo -e "\\n\\e[33;1mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
253252
return
254253
fi
@@ -262,8 +261,8 @@ install:
262261
(cd src/Symfony/Component/HttpFoundation; mv composer.bak composer.json)
263262
COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
264263
265-
if [[ $COMPONENTS && $LEGACY && ! $TRAVIS_BRANCH = *.x && $TRAVIS_PULL_REQUEST != false ]]; then
266-
export FLIP='🙃'
264+
if [[ $COMPONENTS && $LEGACY && ! $TRAVIS_BRANCH = *.x && $TRAVIS_PULL_REQUEST != false && $(echo "$SYMFONY_VERSIONS" | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1) = *.x ]]; then
265+
export FLIP='^'
267266
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
268267
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
269268
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
@@ -283,12 +282,12 @@ install:
283282
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
284283
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
285284
else
286-
if [[ $PHP = 7.4* ]]; then
285+
if [[ $PHP = 8.0* ]]; then
287286
# add return types before running the test suite
288287
sed -i 's/"\*\*\/Tests\/"//' composer.json
289288
composer install --optimize-autoloader
290-
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php
291-
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php # ensure the script is idempotent
289+
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php
290+
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php # ensure the script is idempotent
292291
PHPUNIT_X="$PHPUNIT_X,legacy"
293292
fi
294293

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"friendsofphp/proxy-manager-lts": "^1.0.2",
2222
"doctrine/event-manager": "~1.0",
2323
"doctrine/persistence": "^2",
24-
"twig/twig": "^2.10|^3.0",
24+
"twig/twig": "^2.13|^3.0.4",
2525
"psr/cache": "~1.0",
2626
"psr/container": "^1.0",
2727
"psr/event-dispatcher": "^1.0",
@@ -112,14 +112,14 @@
112112
"async-aws/sqs": "^1.0",
113113
"cache/integration-tests": "dev-master",
114114
"composer/package-versions-deprecated": "^1.8",
115-
"doctrine/annotations": "~1.0",
115+
"doctrine/annotations": "^1.10.4",
116116
"doctrine/cache": "~1.6",
117117
"doctrine/collections": "~1.0",
118118
"doctrine/data-fixtures": "^1.1",
119119
"doctrine/dbal": "^2.10|^3.0",
120120
"doctrine/orm": "^2.7.3",
121121
"doctrine/doctrine-bundle": "^2.0",
122-
"guzzlehttp/promises": "^1.3.1",
122+
"guzzlehttp/promises": "^1.4",
123123
"masterminds/html5": "^2.6",
124124
"monolog/monolog": "^1.25.1|^2",
125125
"nyholm/psr7": "^1.0",
@@ -129,7 +129,7 @@
129129
"predis/predis": "~1.1",
130130
"psr/http-client": "^1.0",
131131
"psr/simple-cache": "^1.0",
132-
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
132+
"egulias/email-validator": "^2.1.10",
133133
"symfony/phpunit-bridge": "^5.2",
134134
"symfony/security-acl": "~2.8|~3.0&quo 570 t;,
135135
"phpdocumentor/reflection-docblock": "^ BAA8 3.0|^4.0|^5.0",
@@ -142,7 +142,7 @@
142142
"doctrine/dbal": "<2.10",
143143
"masterminds/html5": "<2.6",
144144
"phpdocumentor/reflection-docblock": "<3.2.2",
145-
"phpdocumentor/type-resolver": "<0.3.0",
145+
"phpdocumentor/type-resolver": "<1.4.0",
146146
"ocramius/proxy-manager": "<2.1",
147147
"phpunit/phpunit": "<5.4.3"
148148
},

src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testCollectQueries($param, $types, $expected, $explainable, bool
8888

8989
$collectedParam = $collectedQueries['default'][0]['params'][0];
9090
if ($collectedParam instanceof Data) {
91-
$dumper = new CliDumper($out = fopen('php://memory', 'r+b'));
91+
$dumper = new CliDumper($out = fopen('php://memory', 'r+'));
9292
$dumper->setColors(false);
9393
$collectedParam->dump($dumper);
9494
$this->assertStringMatchesFormat($expected, print_r(stream_get_contents($out, -1, 0), true));
@@ -162,7 +162,7 @@ public function testSerialization($param, $types, $expected, $explainable, bool
162162

163163
$collectedParam = $collectedQueries['default'][0]['params'][0];
164164
if ($collectedParam instanceof Data) {
165-
$dumper = new CliDumper($out = fopen('php://memory', 'r+b'));
165+
$dumper = new CliDumper($out = fopen('php://memory', 'r+'));
166166
$dumper->setColors(false);
167167
$collectedParam->dump($dumper);
168168
$this->assertStringMatchesFormat($expected, print_r(stream_get_contents($out, -1, 0), true));

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"symfony/validator": "^5.2",
4545
"symfony/translation": "^4.4|^5.0",
4646
"symfony/var-dumper": "^4.4|^5.0",
47-
"doctrine/annotations": "~1.7",
47+
"doctrine/annotations": "^1.10.4",
4848
"doctrine/cache": "~1.6",
4949
"doctrine/collections": "~1.0",
5050
"doctrine/data-fixtures": "^1.1",

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(array $options = [])
7070
'*' => [$this, 'castObject'],
7171
]);
7272

73-
$this->outputBuffer = fopen('php://memory', 'r+b');
73+
$this->outputBuffer = fopen('php://memory', 'r+');
7474
if ($this->options['multiline']) {
7575
$output = $this->outputBuffer;
7676
} else {

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ public function __construct($message, array $trace, $file)
8787
$this->message = $parsedMsg['deprecation'];
8888
$this->originClass = $parsedMsg['class'];
8989
$this->originMethod = $parsedMsg['method'];
90-
$this->originalFilesStack = $parsedMsg['files_stack'];
90+
if (isset($parsedMsg['files_stack'])) {
91+
$this->originalFilesStack = $parsedMsg['files_stack'];
92+
}
9193
// If the deprecation has been triggered via
9294
// \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest()
9395
// then we need to use the serialized information to determine

0 commit comments

Comments
 (0)
0