Skip to content

Commit 17eaad2

Browse files
Merge branch '5.2' into 5.x
* 5.2: Cleanup CI scripts use the clock mock to make test more resilient fix code style fix code style take query and request parameters into account when matching routes mistake throw type error when incompatible types are passed fix tests to run assertions on returned Crawler instances [FrameworkBundle] Fix UidNormalizer priority propagate groups to nested constraints
2 parents 4e42149 + 85af7a2 commit 17eaad2

File tree

41 files changed

+109
-88
lines changed

Some content is hidden

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

41 files changed

+109
-88
lines changed

.appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ install:
4949
- git config --global user.email ""
5050
- git config --global user.name "Symfony"
5151
- FOR /F "tokens=* USEBACKQ" %%F IN (`bash -c "grep branch-version composer.json | grep -o '[0-9.x]*'"`) DO (SET SYMFONY_VERSION=%%F)
52-
- php .github/build-packages.php "HEAD^" %SYMFONY_VERSION% src\Symfony\Bridge\PhpUnit src\Symfony\Contracts
52+
- php .github/build-packages.php HEAD^ %SYMFONY_VERSION% src\Symfony\Bridge\PhpUnit
5353
- SET "SYMFONY_REQUIRE=>=%SYMFONY_VERSION%"
54-
- SET COMPOSER_ROOT_VERSION=%SYMFONY_VERSION%.x-dev
5554
- php composer.phar update --no-progress --ansi
5655
- php phpunit install
5756

.github/build-packages.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@
66
}
77
chdir(dirname(__DIR__));
88

9-
$json = ltrim(file_get_contents('composer.json'));
10-
if ($json !== $package = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json)) {
11-
file_put_contents('composer.json', $package);
12-
}
13-
149
$dirs = $_SERVER['argv'];
1510
array_shift($dirs);
1611
$mergeBase = trim(shell_exec(sprintf('git merge-base "%s" HEAD', array_shift($dirs))));
1712
$version = array_shift($dirs);
1813

19-
$packages = array();
14+
$packages = [];
2015
$flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
2116
$preferredInstall = json_decode(file_get_contents(__DIR__.'/composer-config.json'), true)['config']['preferred-install'];
2217

@@ -36,12 +31,12 @@
3631
exit(1);
3732
}
3833

39-
$package->repositories = array(array(
34+
$package->repositories = [[
4035
'type' => 'composer',
4136
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
42-
));
37+
]];
4338
if (false === strpos($json, "\n \"repositories\": [\n")) {
44-
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
39+
$json = rtrim(json_encode(['repositories' => $package->repositories], $flags), "\n}").','.substr($json, 1);
4540
file_put_contents($dir.'/composer.json', $json);
4641
}
4742

@@ -61,7 +56,7 @@
6156
$versions = json_decode($versions)->packages->{$package->name};
6257

6358
foreach ($versions as $v => $package) {
64-
$packages[$package->name] += array($v => $package);
59+
$packages[$package->name] += [$v => $package];
6560
}
6661
}
6762

@@ -74,10 +69,12 @@
7469
exit(1);
7570
}
7671

77-
$package->repositories = array(array(
72+
$package->repositories[] = [
7873
'type' => 'composer',
7974
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
80-
));
81-
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
75+
];
76+
77+
$json = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json);
78+
$json = rtrim(json_encode(['repositories' => $package->repositories], $flags), "\n}").','.substr($json, 1);
8279
file_put_contents('composer.json', $json);
8380
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
function getRelevantContent(array $composerJson)
1313
{
14-
$relevantKeys = array(
14+
$relevantKeys = [
1515
'name',
1616
'require',
1717
'require-dev',
@@ -22,9 +22,9 @@ function getRelevantContent(array $composerJson)
2222
'prefer-stable',
2323
'repositories',
2424
'extra',
25-
);
25+
];
2626

27-
$relevantContent = array();
27+
$relevantContent = [];
2828

2929
foreach (array_intersect($relevantKeys, array_keys($composerJson)) as $key) {
3030
$relevantContent[$key] = $composerJson[$key];
@@ -44,7 +44,7 @@ function getContentHash(array $composerJson)
4444
return md5(json_encode($relevantContent));
4545
}
4646

47-
$composerJsons = array();
47+
$composerJsons = [];
4848

4949
foreach ($dirs as $dir) {
5050
if (!file_exists($dir.'/composer.lock') || !$composerLock = @json_decode(file_get_contents($dir.'/composer.lock'), true)) {
@@ -61,11 +61,11 @@ function getContentHash(array $composerJson)
6161
@unlink($dir.'/composer.lock');
6262
continue;
6363
}
64-
$composerLock += array('packages' => array(), 'packages-dev' => array());
65-
$composerJsons[$composerJson['name']] = array($dir, $composerLock['packages'] + $composerLock['packages-dev'], getRelevantContent($composerJson));
64+
$composerLock += ['packages' => [], 'packages-dev' => []];
65+
$composerJsons[$composerJson['name']] = [$dir, $composerLock['packages'] + $composerLock['packages-dev'], getRelevantContent($composerJson)];
6666
}
6767

68-
$referencedCommits = array();
68+
$referencedCommits = [];
6969

7070
foreach ($composerJsons as list($dir, $lockedPackages)) {
7171
foreach ($lockedPackages as $lockedJson) {
@@ -85,7 +85,7 @@ function getContentHash(array $composerJson)
8585
continue;
8686
}
8787

88-
foreach (array('minimum-stability', 'prefer-stable') as $key) {
88+
foreach (['minimum-stability', 'prefer-stable'] as $key) {
8989
if (array_key_exists($key, $composerJsons[$name][2])) {
9090
$lockedJson[$key] = $composerJsons[$name][2][$key];
9191
}
@@ -116,10 +116,10 @@ function getContentHash(array $composerJson)
116116
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
117117
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
118118
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
119-
$chs = array();
119+
$chs = [];
120120

121121
foreach ($referencedCommits as $name => $dirsByCommit) {
122-
$chs[] = $ch = array(curl_init(), fopen($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json', 'wb'));
122+
$chs[] = $ch = [curl_init(), fopen($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json', 'wb')];
123123
curl_setopt($ch[0], CURLOPT_URL, 'https://repo.packagist.org/p/'.$name.'.json');
124124
curl_setopt($ch[0], CURLOPT_FILE, $ch[1]);
125125
curl_setopt($ch[0], CURLOPT_SHARE, $sh);

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
run: |
156156
echo "::group::composer update"
157157
composer require --dev --no-update mongodb/mongodb:@stable
158-
composer update --no-progress --no-suggest --ansi
158+
composer update --no-progress --ansi
159159
echo "::endgroup::"
160160
echo "::group::install phpunit"
161161
./phpunit install

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ install:
185185
export SYMFONY_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*')
186186
187187
if [[ ! $deps ]]; then
188-
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit src/Symfony/Contracts
188+
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit
189189
else
190190
export SYMFONY_DEPRECATIONS_HELPER=weak &&
191191
cp composer.json composer.json.orig &&
@@ -228,7 +228,6 @@ install:
228228
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
229229
[[ $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
230230
231-
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
232231
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
233232
234233
- |
@@ -268,7 +267,6 @@ install:
268267
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
269268
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
270269
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
271-
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
272270
git fetch --depth=2 origin $SYMFONY_VERSION
273271
git checkout -m FETCH_HEAD
274272
COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort)
@@ -287,8 +285,6 @@ install:
287285
else
288286
if [[ $PHP = 7.4* ]]; then
289287
# add return types before running the test suite
290-
rm src/Symfony/Contracts -Rf && mv vendor/symfony/contracts src/Symfony/Contracts
291-
ln -sd $(realpath src/Symfony/Contracts) vendor/symfony/contracts
292288
sed -i 's/"\*\*\/Tests\/"//' composer.json
293289
composer install --optimize-autoloader
294290
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php

UPGRADE-6.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ PhpUnitBridge
145145
PropertyAccess
146146
--------------
147147

148-
* Dropped support of a boolean as the first argument of `PropertyAccessor::__construct()`.
148+
* Dropped support for booleans as the first argument of `PropertyAccessor::__construct()`.
149149
Pass a combination of bitwise flags instead.
150150

151151
PropertyInfo

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public function __construct(RequestStack $requestStack, array $exclusions, $inne
4545

4646
foreach ($exclusions as $exclusion) {
4747
if (!\array_key_exists('code', $exclusion)) {
48-
throw new \LogicException(sprintf('An exclusion must have a "code" key.'));
48+
throw new \LogicException('An exclusion must have a "code" key.');
4949
}
5050
if (!\array_key_exists('urls', $exclusion)) {
51-
throw new \LogicException(sprintf('An exclusion must have a "urls" key.'));
51+
throw new \LogicException('An exclusion must have a "urls" key.');
5252
}
5353
}
5454

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
->tag('serializer.normalizer', ['priority' => 1000])
110110

111111
->set('serializer.normalizer.uid', UidNormalizer::class)
112-
->tag('serializer.normalizer', ['priority' => -915])
112+
->tag('serializer.normalizer', ['priority' => -890])
113113

114114
->set('serializer.normalizer.form_error', FormErrorNormalizer::class)
115115
->tag('serializer.normalizer', ['priority' => -915])

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ private function getEventDispatcherDescriptionTestData(array $objects)
302302
}
303303

304304
/** @dataProvider getDescribeContainerBuilderWithPriorityTagsTestData */
305-
public function testDescribeContainerBuilderWithPriorityTags(ContainerBuilder $builder, $expectedDescription, array $options): void
305+
public function testDescribeContainerBuilderWithPriorityTags(ContainerBuilder $builder, $expectedDescription, array $options)
306306
{
307307
$this->assertDescription($expectedDescription, $builder, $options);
308308
}

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'initial_marking' => ['draft'],
1313
'metadata' => [
1414
'title' => 'article workflow',
15-
'description' => 'workflow for articles'
15+
'description' => 'workflow for articles',
1616
],
1717
'places' => [
1818
'draft',

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