Skip to content

Commit ff8ad7e

Browse files
committed
Update BetterReflection
1 parent 51a284b commit ff8ad7e

File tree

7 files changed

+21
-39
lines changed

7 files changed

+21
-39
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"nette/utils": "^3.2.5",
2424
"nikic/php-parser": "^4.15.5",
2525
"ondram/ci-detector": "^3.4.0",
26-
"ondrejmirtes/better-reflection": "6.8.0.1",
26+
"ondrejmirtes/better-reflection": "6.11.0.0",
2727
"phpstan/php-8-stubs": "0.3.60",
2828
"phpstan/phpdoc-parser": "1.22.0",
2929
"react/async": "^3",

composer.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,6 @@ parameters:
277277
count: 1
278278
path: src/Reflection/BetterReflection/BetterReflectionProvider.php
279279

280-
-
281-
message: "#^Dead catch \\- PHPStan\\\\BetterReflection\\\\Reflection\\\\Exception\\\\NotAClassReflection is never thrown in the try block\\.$#"
282-
count: 1
283-
path: src/Reflection/BetterReflection/BetterReflectionProvider.php
284-
285-
-
286-
message: "#^Dead catch \\- PHPStan\\\\BetterReflection\\\\Reflection\\\\Exception\\\\NotAnInterfaceReflection is never thrown in the try block\\.$#"
287-
count: 1
288-
path: src/Reflection/BetterReflection/BetterReflectionProvider.php
289-
290280
-
291281
message: """
292282
#^Call to deprecated method getTypeFromValue\\(\\) of class PHPStan\\\\Type\\\\ConstantTypeHelper\\:

src/Analyser/FileAnalyser.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
use PHPStan\AnalysedCodeException;
88
use PHPStan\BetterReflection\NodeCompiler\Exception\UnableToCompileNode;
99
use PHPStan\BetterReflection\Reflection\Exception\CircularReference;
10-
use PHPStan\BetterReflection\Reflection\Exception\NotAClassReflection;
11-
use PHPStan\BetterReflection\Reflection\Exception\NotAnInterfaceReflection;
1210
use PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound;
1311
use PHPStan\Collectors\CollectedData;
1412
use PHPStan\Collectors\Registry as CollectorRegistry;
@@ -104,7 +102,7 @@ public function analyseFile(
104102
} catch (IdentifierNotFound $e) {
105103
$fileErrors[] = new Error(sprintf('Reflection error: %s not found.', $e->getIdentifier()->getName()), $file, $node->getLine(), $e, null, null, 'Learn more at https://phpstan.org/user-guide/discovering-symbols');
106104
continue;
107-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection | CircularReference $e) {
105+
} catch (UnableToCompileNode | CircularReference $e) {
108106
$fileErrors[] = new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, $node->getLine(), $e);
109107
continue;
110108
}
@@ -140,7 +138,7 @@ public function analyseFile(
140138
} catch (IdentifierNotFound $e) {
141139
$fileErrors[] = new Error(sprintf('Reflection error: %s not found.', $e->getIdentifier()->getName()), $file, $node->getLine(), $e, null, null, 'Learn more at https://phpstan.org/user-guide/discovering-symbols');
142140
continue;
143-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection | CircularReference $e) {
141+
} catch (UnableToCompileNode | CircularReference $e) {
144142
$fileErrors[] = new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, $node->getLine(), $e);
145143
continue;
146144
}
@@ -168,7 +166,7 @@ public function analyseFile(
168166
// pass
169167
} catch (IdentifierNotFound) {
170168
// pass
171-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection) {
169+
} catch (UnableToCompileNode) {
172170
// pass
173171
}
174172
};
@@ -228,7 +226,7 @@ public function analyseFile(
228226
$fileErrors[] = new Error($e->getMessage(), $file, null, $e, null, null, $e->getTip());
229227
} catch (IdentifierNotFound $e) {
230228
$fileErrors[] = new Error(sprintf('Reflection error: %s not found.', $e->getIdentifier()->getName()), $file, null, $e, null, null, 'Learn more at https://phpstan.org/user-guide/discovering-symbols');
231-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection | CircularReference $e) {
229+
} catch (UnableToCompileNode | CircularReference $e) {
232230
$fileErrors[] = new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, null, $e);
233231
}
234232
} elseif (is_dir($file)) {

src/Command/AnalyseApplication.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use PHPStan\Analyser\ScopeFactory;
1313
use PHPStan\BetterReflection\NodeCompiler\Exception\UnableToCompileNode;
1414
use PHPStan\BetterReflection\Reflection\Exception\CircularReference;
15-
use PHPStan\BetterReflection\Reflection\Exception\NotAClassReflection;
16-
use PHPStan\BetterReflection\Reflection\Exception\NotAnInterfaceReflection;
1715
use PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound;
1816
use PHPStan\Collectors\CollectedData;
1917
use PHPStan\Internal\BytesHelper;
@@ -167,7 +165,7 @@ private function getCollectedDataErrors(array $collectedData): array
167165
} catch (IdentifierNotFound $e) {
168166
$errors[] = new Error(sprintf('Reflection error: %s not found.', $e->getIdentifier()->getName()), $file, $node->getLine(), $e, null, null, 'Learn more at https://phpstan.org/user-guide/discovering-symbols');
169167
continue;
170-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection | CircularReference $e) {
168+
} catch (UnableToCompileNode | CircularReference $e) {
171169
$errors[] = new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, $node->getLine(), $e);
172170
continue;
173171
}

src/Command/FixerWorkerCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use PHPStan\Analyser\ScopeFactory;
1313
use PHPStan\BetterReflection\NodeCompiler\Exception\UnableToCompileNode;
1414
use PHPStan\BetterReflection\Reflection\Exception\CircularReference;
15-
use PHPStan\BetterReflection\Reflection\Exception\NotAClassReflection;
16-
use PHPStan\BetterReflection\Reflection\Exception\NotAnInterfaceReflection;
1715
use PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound;
1816
use PHPStan\Collectors\CollectedData;
1917
use PHPStan\DependencyInjection\Container;
@@ -194,7 +192,7 @@ private function getCollectedDataErrors(Container $container, array $collectedDa
194192
} catch (IdentifierNotFound $e) {
195193
$errors[] = new Error(sprintf('Reflection error: %s not found.', $e->getIdentifier()->getName()), $file, $node->getLine(), $e, null, null, 'Learn more at https://phpstan.org/user-guide/discovering-symbols');
196194
continue;
197-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection | CircularReference $e) {
195+
} catch (UnableToCompileNode | CircularReference $e) {
198196
$errors[] = new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, $node->getLine(), $e);
199197
continue;
200198
}

src/Reflection/BetterReflection/BetterReflectionProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass;
1111
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionFunction;
1212
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionParameter;
13-
use PHPStan\BetterReflection\Reflection\Exception\NotAClassReflection;
14-
use PHPStan\BetterReflection\Reflection\Exception\NotAnInterfaceReflection;
1513
use PHPStan\BetterReflection\Reflection\ReflectionEnum;
1614
use PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound;
1715
use PHPStan\BetterReflection\Reflector\Reflector;
@@ -364,7 +362,7 @@ public function resolveConstantName(Node\Name $nameNode, ?NamespaceAnswerer $nam
364362
return true;
365363
} catch (IdentifierNotFound) {
366364
// pass
367-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection) {
365+
} catch (UnableToCompileNode) {
368366
// pass
369367
}
370368
return false;

0 commit comments

Comments
 (0)