Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcee0489

Browse files
Enforce return types on all components
1 parent0144981 commitcee0489

File tree

33 files changed

+84
-920
lines changed

33 files changed

+84
-920
lines changed

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

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

‎.github/patch-types.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
casefalse !==strpos($file,'/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
4545
casefalse !==strpos($file,'/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/'):
4646
casefalse !==strpos($file,'/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
47-
casefalse !==strpos($file,'/src/Symfony/Component/HttpClient/Internal/') &&str_contains($file,'V5'):
48-
casefalse !==strpos($file,'/src/Symfony/Component/PropertyAccess/Tests/Fixtures/AsymmetricVisibility.php'):
47+
casefalse !==strpos($file,'/src/Symfony/Component/HttpClient/Internal/') &&str_contains($file,'V4'):
4948
casefalse !==strpos($file,'/src/Symfony/Component/PropertyInfo/Tests/Fixtures/'):
5049
casefalse !==strpos($file,'/src/Symfony/Component/Runtime/Internal/ComposerPlugin.php'):
5150
casefalse !==strpos($file,'/src/Symfony/Component/Security/Http/Tests/Fixtures/IsGrantedAttributeMethodsWithClosureController.php'):
@@ -55,7 +54,6 @@
5554
casefalse !==strpos($file,'/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/WhenTestWithClosure.php'):
5655
casefalse !==strpos($file,'/src/Symfony/Component/Validator/Tests/Fixtures/NestedAttribute/Entity.php'):
5756
casefalse !==strpos($file,'/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
58-
casefalse !==strpos($file,'/src/Symfony/Component/VarDumper/Tests/Fixtures/VirtualProperty.php'):
5957
casefalse !==strpos($file,'/src/Symfony/Component/VarExporter/Internal'):
6058
casefalse !==strpos($file,'/src/Symfony/Component/VarExporter/Tests/Fixtures/'):
6159
casefalse !==strpos($file,'/src/Symfony/Contracts/'):

‎.github/workflows/unit-tests.yml‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,12 @@ jobs:
148148
./phpunit install
149149
echo "::endgroup::"
150150
151-
-name:Patch return types
151+
-name:Check return types
152152
if:"matrix.php == '8.4' && ! matrix.mode"
153153
run:|
154-
patch -sp1 < .github/expected-missing-return-types.diff
155-
git add .
156154
sed -i 's/ *"\*\*\/Tests\/",//' composer.json
157155
composer install -q --optimize-autoloader || composer install --optimize-autoloader
158-
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.4' php .github/patch-types.php
159-
git checkout composer.json src/Symfony/Contracts/Service/ResetInterface.php
160-
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.4' php .github/patch-types.php # ensure the script is idempotent
161-
git checkout src/Symfony/Contracts/Service/ResetInterface.php
162-
git diff --exit-code
163-
164-
-name:Check return types
165-
if:"matrix.php == '8.4' && ! matrix.mode"
166-
run:|
156+
git checkout composer.json
167157
php .github/patch-types.php lint
168158
169159
-name:Run tests
@@ -209,7 +199,7 @@ jobs:
209199
PATCHED_COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
210200
211201
# for 7.4 LTS, checkout and test previous major with the patched components (only for patched components)
212-
if [[ $PATCHED_COMPONENTS && $SYMFONY_VERSION = 7.4 ]]; then
202+
if [[ $PATCHED_COMPONENTS && $SYMFONY_VERSION = 7.4&& $FLIP = '']]; then
213203
export FLIP='^'
214204
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
215205
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"

‎src/Symfony/Bridge/Twig/Test/Traits/RuntimeLoaderProvider.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717

1818
trait RuntimeLoaderProvider
1919
{
20-
/**
21-
* @return void
22-
*/
23-
protectedfunctionregisterTwigRuntimeLoader(Environment$environment,FormRenderer$renderer)
20+
protectedfunctionregisterTwigRuntimeLoader(Environment$environment,FormRenderer$renderer):void
2421
{
2522
$loader =$this->createMock(RuntimeLoaderInterface::class);
2623
$loader->expects($this->any())->method('load')->willReturnMap([

‎src/Symfony/Component/BrowserKit/AbstractBrowser.php‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,11 @@ public function request(string $method, string $uri, array $parameters = [], arr
413413
*
414414
* @psalm-param TRequest $request
415415
*
416-
* @return object
417-
*
418416
* @psalm-return TResponse
419417
*
420418
* @throws \RuntimeException When processing returns exit code
421419
*/
422-
protectedfunctiondoRequestInProcess(object$request)
420+
protectedfunctiondoRequestInProcess(object$request):object
423421
{
424422
$deprecationsFile =tempnam(sys_get_temp_dir(),'deprec');
425423
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$deprecationsFile);
@@ -452,11 +450,9 @@ protected function doRequestInProcess(object $request)
452450
*
453451
* @psalm-param TRequest $request
454452
*
455-
* @return object
456-
*
457453
* @psalm-return TResponse
458454
*/
459-
abstractprotectedfunctiondoRequest(object$request);
455+
abstractprotectedfunctiondoRequest(object$request):object;
460456

461457
/**
462458
* Returns the script to execute when the request must be insulated.
@@ -465,23 +461,19 @@ abstract protected function doRequest(object $request);
465461
*
466462
* @param object $request An origin request instance
467463
*
468-
* @return string
469-
*
470464
* @throws LogicException When this abstract class is not implemented
471465
*/
472-
protectedfunctiongetScript(object$request)
466+
protectedfunctiongetScript(object$request):string
473467
{
474468
thrownewLogicException('To insulate requests, you need to override the getScript() method.');
475469
}
476470

477471
/**
478472
* Filters the BrowserKit request to the origin one.
479473
*
480-
* @return object
481-
*
482474
* @psalm-return TRequest
483475
*/
484-
protectedfunctionfilterRequest(Request$request)
476+
protectedfunctionfilterRequest(Request$request):object
485477
{
486478
return$request;
487479
}
@@ -490,10 +482,8 @@ protected function filterRequest(Request $request)
490482
* Filters the origin response to the BrowserKit one.
491483
*
492484
* @psalm-param TResponse $response
493-
*
494-
* @return Response
495485
*/
496-
protectedfunctionfilterResponse(object$response)
486+
protectedfunctionfilterResponse(object$response):Response
497487
{
498488
return$response;
499489
}

‎src/Symfony/Component/Console/Command/Command.php‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,8 @@ public function isEnabled(): bool
197197

198198
/**
199199
* Configures the current command.
200-
*
201-
* @return void
202200
*/
203-
protectedfunctionconfigure()
201+
protectedfunctionconfigure():void
204202
{
205203
}
206204

@@ -229,10 +227,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
229227
* This method is executed before the InputDefinition is validated.
230228
* This means that this is the only place where the command can
231229
* interactively ask for values of missing required arguments.
232-
*
233-
* @return void
234230
*/
235-
protectedfunctioninteract(InputInterface$input,OutputInterface$output)
231+
protectedfunctioninteract(InputInterface$input,OutputInterface$output):void
236232
{
237233
}
238234

@@ -245,10 +241,8 @@ protected function interact(InputInterface $input, OutputInterface $output)
245241
*
246242
* @see InputInterface::bind()
247243
* @see InputInterface::validate()
248-
*
249-
* @return void
250244
*/
251-
protectedfunctioninitialize(InputInterface$input,OutputInterface$output)
245+
protectedfunctioninitialize(InputInterface$input,OutputInterface$output):void
252246
{
253247
}
254248

‎src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ abstract class AbstractRecursivePass implements CompilerPassInterface
3434
privateExpressionLanguage$expressionLanguage;
3535
privatebool$inExpression =false;
3636

37-
/**
38-
* @return void
39-
*/
40-
publicfunctionprocess(ContainerBuilder$container)
37+
publicfunctionprocess(ContainerBuilder$container):void
4138
{
4239
$this->container =$container;
4340

@@ -65,10 +62,8 @@ protected function inExpression(bool $reset = true): bool
6562

6663
/**
6764
* Processes a value found in a definition tree.
68-
*
69-
* @return mixed
7065
*/
71-
protectedfunctionprocessValue(mixed$value,bool$isRoot =false)
66+
protectedfunctionprocessValue(mixed$value,bool$isRoot =false):mixed
7267
{
7368
if (\is_array($value)) {
7469
foreach ($valueas$k =>$v) {

‎src/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ interface CompilerPassInterface
2222
{
2323
/**
2424
* You can modify the container here before it is dumped to PHP code.
25-
*
26-
* @return void
2725
*/
28-
publicfunctionprocess(ContainerBuilder$container);
26+
publicfunctionprocess(ContainerBuilder$container):void;
2927
}

‎src/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,5 @@
2121
*/
2222
interface ConfigurationExtensionInterface
2323
{
24-
/**
25-
* Returns extension configuration.
26-
*
27-
* @return ConfigurationInterface|null
28-
*/
29-
publicfunctiongetConfiguration(array$config,ContainerBuilder$container);
24+
publicfunctiongetConfiguration(array$config,ContainerBuilder$container): ?ConfigurationInterface;
3025
}

‎src/Symfony/Component/DependencyInjection/Extension/Extension.php‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ abstract class Extension implements ExtensionInterface, ConfigurationExtensionIn
2828
{
2929
privatearray$processedConfigs = [];
3030

31-
/**
32-
* @return string|false
33-
*/
34-
publicfunctiongetXsdValidationBasePath()
31+
publicfunctiongetXsdValidationBasePath():string|false
3532
{
3633
returnfalse;
3734
}
3835

39-
/**
40-
* @return string
41-
*/
42-
publicfunctiongetNamespace()
36+
publicfunctiongetNamespace():string
4337
{
4438
return'http://example.org/schema/dic/'.$this->getAlias();
4539
}
@@ -73,10 +67,7 @@ public function getAlias(): string
7367
return Container::underscore($classBaseName);
7468
}
7569

76-
/**
77-
* @return ConfigurationInterface|null
78-
*/
79-
publicfunctiongetConfiguration(array$config,ContainerBuilder$container)
70+
publicfunctiongetConfiguration(array$config,ContainerBuilder$container): ?ConfigurationInterface
8071
{
8172
$class =static::class;
8273

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp