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

Skip to content

[Contracts] Add missing return types #49407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/expected-missing-return-types.diff
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sed -i 's/ *"\*\*\/Tests\/"//' composer.json
composer u -o
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1' php .github/patch-types.php
head=$(sed '/^diff /Q' .github/expected-missing-return-types.diff)
git checkout src/Symfony/Contracts/Service/ResetInterface.php
(echo "$head" && echo && git diff -U2 src/) > .github/expected-missing-return-types.diff
git checkout composer.json src/

Expand Down Expand Up @@ -13417,6 +13418,17 @@ index c1a77ad157..1e926dc83a 100644
+ public function setParsedLine(int $parsedLine): void
{
$this->parsedLine = $parsedLine;
diff --git a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php b/src/Symfony/Contracts/Translation/LocaleAwareInterface.php
index db40ba13e0..48928ca959 100644
--- a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php
+++ b/src/Symfony/Contracts/Translation/LocaleAwareInterface.php
@@ -21,5 +21,5 @@ interface LocaleAwareInterface
* @throws \InvalidArgumentException If the locale contains invalid characters
*/
- public function setLocale(string $locale);
+ public function setLocale(string $locale): void;

/**
diff --git a/src/Symfony/Contracts/Translation/TranslatorTrait.php b/src/Symfony/Contracts/Translation/TranslatorTrait.php
index e3b0adff05..19d90162ab 100644
--- a/src/Symfony/Contracts/Translation/TranslatorTrait.php
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ jobs:
git add .
composer install -q --optimize-autoloader
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1' php .github/patch-types.php
git checkout src/Symfony/Contracts/Service/ResetInterface.php
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1' php .github/patch-types.php # ensure the script is idempotent
git checkout src/Symfony/Contracts/Service/ResetInterface.php
git diff --exit-code

- name: Run tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function trans($id, array $parameters = [], $domain = null, $locale = nul
return 'translated max {{ max }}!';
}

public function setLocale($locale)
public function setLocale($locale): void
{
}

Expand Down
9 changes: 6 additions & 3 deletions src/Symfony/Component/HttpClient/Response/MockResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
class MockResponse implements ResponseInterface, StreamableInterface
{
use CommonResponseTrait;
use TransportResponseTrait {
doDestruct as public __destruct;
}
use TransportResponseTrait;

private string|iterable $body;
private array $requestOptions = [];
Expand Down Expand Up @@ -106,6 +104,11 @@ public function cancel(): void
}
}

public function __destruct()
{
$this->doDestruct();
}

protected function close(): void
{
$this->inflate = null;
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Contracts/Service/ResetInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
*/
interface ResetInterface
{
/**
* @return void
*/
public function reset();
}
2 changes: 2 additions & 0 deletions src/Symfony/Contracts/Translation/LocaleAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface LocaleAwareInterface
/**
* Sets the current locale.
*
* @return void
*
* @throws \InvalidArgumentException If the locale contains invalid characters
*/
public function setLocale(string $locale);
Expand Down