Skip to content

Commit c094166

Browse files
committed
Update phpstan
1 parent 99b85fa commit c094166

File tree

58 files changed

+343
-1768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+343
-1768
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use PhpCsFixer\Config;
44

55
$finder = PhpCsFixer\Finder::create()
6-
->in('lib')
6+
->in('src')
77
->in('tests')
88
->exclude([
99
'Workspace',

.styleci.yml

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

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpactor/class-to-file": "~0.5.0",
2525
"phpactor/test-utils": "^1.1.5",
2626
"phpbench/phpbench": "dev-master",
27-
"phpstan/phpstan": "~0.12.0",
27+
"phpstan/phpstan": "^1.0",
2828
"phpunit/phpunit": "^9.0",
2929
"symfony/filesystem": "^6.0",
3030
"phpspec/prophecy-phpunit": "^2.0",
@@ -50,7 +50,7 @@
5050
"scripts": {
5151
"integrate": [
5252
"./vendor/bin/php-cs-fixer fix --allow-risky=yes",
53-
"./vendor/bin/phpstan analyse lib -c phpstan.neon",
53+
"./vendor/bin/phpstan analyse --memory-limit=1G",
5454
"./vendor/bin/phpunit",
5555
"./vendor/bin/phpbench run --iterations=1",
5656
"./tests/Smoke/smoke_test.php --limit=100"

phpstan-baseline.neon

Lines changed: 132 additions & 1658 deletions
Large diffs are not rendered by default.

phpstan.neon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ includes:
22
- phpstan-baseline.neon
33
parameters:
44
level: 7
5-
inferPrivatePropertyTypeFromConstructor: true
6-
reportUnmatchedIgnoredErrors: true
7-
checkGenericClassInNonGenericObjectType: false
5+
excludePaths:
6+
- src/Core/SourceCodeLocator/InternalStubs/GenericTypes.php
7+
88
paths:
9-
- lib
9+
- src

src/Bridge/TolerantParser/Diagnostics/AssignmentToMissingPropertyDiagnostic.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function __construct(
1717
private bool $isSubscriptAssignment
1818
) {
1919
}
20+
2021
public function range(): ByteOffsetRange
2122
{
2223
return $this->range;

src/Bridge/TolerantParser/Diagnostics/DeprecatedUsageDiagnosticProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ private function memberAccessDiagnostics(MemberAccessContext $resolved): Generat
245245
$member->memberType(),
246246
);
247247
}
248+
248249
/**
249250
* @return Generator<DeprecatedUsageDiagnostic>
250251
*/
@@ -262,6 +263,7 @@ private function classLikeDiagnostics(ClassLikeContext $resolved): Generator
262263
$reflectionClass->classLikeType(),
263264
);
264265
}
266+
265267
/**
266268
* @return Generator<DeprecatedUsageDiagnostic>
267269
*/

src/Bridge/TolerantParser/Diagnostics/Docblock/ClassGenericDiagnosticHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function diagnosticsForExtends(
3232
yield from $this->fromReflectionClass($reflector, $range, $class, $parentClass, $class->docblock()->extends(), '@extends');
3333
}
3434
}
35+
3536
/**
3637
* @return Generator<Diagnostic>
3738
*/

src/Bridge/TolerantParser/Diagnostics/DocblockMissingClassGenericDiagnostic.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
class DocblockMissingClassGenericDiagnostic implements Diagnostic
1212
{
13-
1413
public function __construct(
1514
private ByteOffsetRange $range,
1615
private ClassName $className,

src/Bridge/TolerantParser/Diagnostics/MissingReturnTypeProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ function foo() {
8787
}
8888
);
8989
}
90+
9091
public function exit(NodeContextResolver $resolver, Frame $frame, Node $node): iterable
9192
{
9293
if (!$node instanceof MethodDeclaration) {

0 commit comments

Comments
 (0)