Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9eef0f

Browse files
minor #49407 [Contracts] Add missing return types (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [Contracts] Add missing return types | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 63a86d9 [Contracts] Add missing return types
2 parents 5d557de + 63a86d9 commit b9eef0f

File tree

6 files changed

+26
-4
lines changed

6 files changed

+26
-4
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sed -i 's/ *"\*\*\/Tests\/"//' composer.json
33
composer u -o
44
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1' php .github/patch-types.php
55
head=$(sed '/^diff /Q' .github/expected-missing-return-types.diff)
6+
git checkout src/Symfony/Contracts/Service/ResetInterface.php
67
(echo "$head" && echo && git diff -U2 src/) > .github/expected-missing-return-types.diff
78
git checkout composer.json src/
89

@@ -13417,6 +13418,17 @@ index c1a77ad157..1e926dc83a 100644
1341713418
+ public function setParsedLine(int $parsedLine): void
1341813419
{
1341913420
$this->parsedLine = $parsedLine;
13421+
diff --git a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php b/src/Symfony/Contracts/Translation/LocaleAwareInterface.php
13422+
index db40ba13e0..48928ca959 100644
13423+
--- a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php
13424+
+++ b/src/Symfony/Contracts/Translation/LocaleAwareInterface.php
13425+
@@ -21,5 +21,5 @@ interface LocaleAwareInterface
13426+
* @throws \InvalidArgumentException If the locale contains invalid characters
13427+
*/
13428+
- public function setLocale(string $locale);
13429+
+ public function setLocale(string $locale): void;
13430+
13431+
/**
1342013432
diff --git a/src/Symfony/Contracts/Translation/TranslatorTrait.php b/src/Symfony/Contracts/Translation/TranslatorTrait.php
1342113433
index e3b0adff05..19d90162ab 100644
1342213434
--- a/src/Symfony/Contracts/Translation/TranslatorTrait.php

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ jobs:
143143
git add .
144144
composer install -q --optimize-autoloader
145145
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1' php .github/patch-types.php
146+
git checkout src/Symfony/Contracts/Service/ResetInterface.php
146147
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1' php .github/patch-types.php # ensure the script is idempotent
148+
git checkout src/Symfony/Contracts/Service/ResetInterface.php
147149
git diff --exit-code
148150
149151
- name: Run tests

src/Symfony/Component/Form/Tests/Extension/Validator/Type/UploadValidatorExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function trans($id, array $parameters = [], $domain = null, $locale = nul
4242
return 'translated max {{ max }}!';
4343
}
4444

45-
public function setLocale($locale)
45+
public function setLocale($locale): void
4646
{
4747
}
4848

src/Symfony/Component/HttpClient/Response/MockResponse.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
class MockResponse implements ResponseInterface, StreamableInterface
2727
{
2828
use CommonResponseTrait;
29-
use TransportResponseTrait {
30-
doDestruct as public __destruct;
31-
}
29+
use TransportResponseTrait;
3230

3331
private string|iterable $body;
3432
private array $requestOptions = [];
@@ -106,6 +104,11 @@ public function cancel(): void
106104
}
107105
}
108106

107+
public function __destruct()
108+
{
109+
$this->doDestruct();
110+
}
111+
109112
protected function close(): void
110113
{
111114
$this->inflate = null;

src/Symfony/Contracts/Service/ResetInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
*/
2727
interface ResetInterface
2828
{
29+
/**
30+
* @return void
31+
*/
2932
public function reset();
3033
}

src/Symfony/Contracts/Translation/LocaleAwareInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ interface LocaleAwareInterface
1616
/**
1717
* Sets the current locale.
1818
*
19+
* @return void
20+
*
1921
* @throws \InvalidArgumentException If the locale contains invalid characters
2022
*/
2123
public function setLocale(string $locale);

0 commit comments

Comments
 (0)