Skip to content

Commit e809d8d

Browse files
committed
Refresh PHPStan
1 parent 6a2f6c7 commit e809d8d

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

phpstan-baseline.neon

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ parameters:
144144
count: 1
145145
path: src/DependencyInjection/Compiler/PingDBALConnectionsCompilerPass.php
146146

147+
-
148+
message: '#^Method BabDev\\WebSocketBundle\\DependencyInjection\\Factory\\Authentication\\AuthenticationProviderFactory\:\:addConfiguration\(\) has parameter \$builder with generic class Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition but does not specify its types\: TParent$#'
149+
identifier: missingType.generics
150+
count: 1
151+
path: src/DependencyInjection/Factory/Authentication/AuthenticationProviderFactory.php
152+
147153
-
148154
message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#'
149155
identifier: method.notFound
@@ -192,14 +198,20 @@ parameters:
192198
count: 1
193199
path: src/DependencyInjection/Factory/Authentication/SessionAuthenticationProviderFactory.php
194200

201+
-
202+
message: '#^Method BabDev\\WebSocketBundle\\DependencyInjection\\Factory\\Authentication\\SessionAuthenticationProviderFactory\:\:addConfiguration\(\) has parameter \$builder with generic class Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition but does not specify its types\: TParent$#'
203+
identifier: missingType.generics
204+
count: 1
205+
path: src/DependencyInjection/Factory/Authentication/SessionAuthenticationProviderFactory.php
206+
195207
-
196208
message: '#^Parameter \#1 \$class of function class_exists expects string, mixed given\.$#'
197209
identifier: argument.type
198210
count: 1
199211
path: src/Routing/Loader/AttributeLoader.php
200212

201213
-
202-
message: '#^Parameter \#1 \$path of method Symfony\\Component\\Routing\\Loader\\AttributeClassLoader\:\:createRoute\(\) expects string, mixed given\.$#'
214+
message: '#^Parameter \#1 \$path of method Symfony\\Component\\Routing\\Loader\\AttributeClassLoader\:\:createRoute\(\) expects string, string\|null given\.$#'
203215
identifier: argument.type
204216
count: 1
205217
path: src/Routing/Loader/AttributeLoader.php
@@ -222,12 +234,6 @@ parameters:
222234
count: 1
223235
path: src/Routing/Loader/AttributeLoader.php
224236

225-
-
226-
message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
227-
identifier: argument.type
228-
count: 1
229-
path: src/Routing/Loader/AttributeLoader.php
230-
231237
-
232238
message: '#^Cannot use array destructuring on \(list\<\(BabDev\\WebSocket\\Server\\WAMP\\WAMPConnection&PHPUnit\\Framework\\MockObject\\MockObject\)\|string\>\)\|null\.$#'
233239
identifier: offsetAccess.nonArray

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ parameters:
66
paths:
77
- %currentWorkingDirectory%/src
88
- %currentWorkingDirectory%/tests
9+
excludePaths:
10+
- %currentWorkingDirectory%/src/DependencyInjection/Configuration.php # PHPStan's Symfony extension doesn't know how to work with the generics added in 7.4
911
treatPhpDocTypesAsCertain: false
1012
ignoreErrors:
1113
-

src/DependencyInjection/Configuration.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
*/
2020
public function __construct(private array $authenticationProviderFactories) {}
2121

22+
/**
23+
* @return TreeBuilder<'array'>
24+
*/
2225
public function getConfigTreeBuilder(): TreeBuilder
2326
{
27+
/** @var TreeBuilder<'array'> $treeBuilder */
2428
$treeBuilder = new TreeBuilder('babdev_websocket');
2529

2630
$rootNode = $treeBuilder->getRootNode();
@@ -31,6 +35,9 @@ public function getConfigTreeBuilder(): TreeBuilder
3135
return $treeBuilder;
3236
}
3337

38+
/**
39+
* @param ArrayNodeDefinition<TreeBuilder<'array'>> $rootNode
40+
*/
3441
private function addAuthenticationSection(ArrayNodeDefinition $rootNode): void
3542
{
3643
$authenticationNode = $rootNode->children()
@@ -40,6 +47,9 @@ private function addAuthenticationSection(ArrayNodeDefinition $rootNode): void
4047
$this->addAuthenticationProvidersSection($authenticationNode);
4148
}
4249

50+
/**
51+
* @param ArrayNodeDefinition<TreeBuilder<'array'>> $authenticationNode
52+
*/
4353
private function addAuthenticationProvidersSection(ArrayNodeDefinition $authenticationNode): void
4454
{
4555
$providerNodeBuilder = $authenticationNode
@@ -56,6 +66,9 @@ private function addAuthenticationProvidersSection(ArrayNodeDefinition $authenti
5666
}
5767
}
5868

69+
/**
70+
* @param ArrayNodeDefinition<TreeBuilder<'array'>> $rootNode
71+
*/
5972
private function addServerSection(ArrayNodeDefinition $rootNode): void
6073
{
6174
$rootNode->children()

0 commit comments

Comments
 (0)