Skip to content

Commit a9b9e4e

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: [5.4] Remove unused test fixtures [Dotent] Add PHPDoc for `$overrideExistingVars` [SecurityBundle] Fix missing login-link element in xsd schema [Validator] Add missing Chinese translations #51934 [Serializer] Fix using `DateIntervalNormalizer` with union types [Validator] fix: add missing translations for for Thai (th) fix #52273 [doctrine-messenger] DB table locks on messenger_messages with many failures [Serializer] Handle defaultContext for DateTimeNormalizer [CI] Add step to verify symfony/deprecation-contracts requirements
2 parents 22f1ea0 + ce87255 commit a9b9e4e

File tree

21 files changed

+146
-233
lines changed

21 files changed

+146
-233
lines changed

.github/get-modified-packages.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ function getPackageType(string $packageDir): string
6666

6767
$output = [];
6868
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)];
69+
$composerData = json_decode(file_get_contents($directory.'/composer.json'), true);
70+
$name = $composerData['name'] ?? 'unknown';
71+
$requiresDeprecationContracts = isset($composerData['require']['symfony/deprecation-contracts']);
72+
$output[] = ['name' => $name, 'directory' => $directory, 'new' => $newPackage[$directory] ?? false, 'type' => getPackageType($directory), 'requires_deprecation_contracts' => $requiresDeprecationContracts];
7173
}
7274

7375
echo json_encode($output);

.github/workflows/package-tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,44 @@ jobs:
100100
fi
101101
done
102102
103+
exit $ok
104+
- name: Verify symfony/deprecation-contracts requirements
105+
run: |
106+
set +e
107+
108+
ok=0
109+
json='${{ steps.find-packages.outputs.packages }}'
110+
for package in $(echo "${json}" | jq -r '.[] | @base64'); do
111+
_jq() {
112+
echo ${package} | base64 --decode | jq -r ${1}
113+
}
114+
115+
NAME=$(_jq '.name')
116+
if [[ $NAME = 'symfony/deprecation-contracts' || $NAME = 'symfony/contracts' ]]; then
117+
continue
118+
fi
119+
120+
echo "::group::$NAME"
121+
DIR=$(_jq '.directory')
122+
localExit=0
123+
grep -rq 'trigger_deprecation(' --include=*.php --exclude-dir=Tests/ --exclude-dir=Bridge/ $DIR
124+
triggersDeprecation=$?
125+
if [[ $triggersDeprecation -eq 0 && $(_jq '.requires_deprecation_contracts') == false ]]; then
126+
errorMessage="::error::$NAME does not require symfony/deprecation-contracts but triggers at least one deprecation"
127+
localExit=1
128+
elif [[ $triggersDeprecation -eq 1 && $(_jq '.requires_deprecation_contracts') == true ]]; then
129+
errorMessage="::error::$NAME requires symfony/deprecation-contracts but does not trigger any deprecation"
130+
localExit=1
131+
elif [[ $triggersDeprecation -ne 0 && $triggersDeprecation -ne 1 ]]; then
132+
echo "::error::grep failed"
133+
exit 2
134+
fi
135+
136+
ok=$(( $localExit || $ok ))
137+
echo ::endgroup::
138+
if [ $localExit -ne 0 ]; then
139+
echo $errorMessage
140+
fi
141+
done
142+
103143
exit $ok

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/DefaultController.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Sub/DefaultController.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Test/DefaultController.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/Controller/DefaultController.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/Controller/DefaultController.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)