Skip to content

Commit 5acae33

Browse files
committed
Get ready for merge
1 parent bdf0f44 commit 5acae33

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

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'))->withIdentifier('phpstan.reflection');
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))->withIdentifier('phpstan.reflection');
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'))->withIdentifier('phpstan.reflection');
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))->withIdentifier('phpstan.reflection');
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
};
@@ -223,7 +221,7 @@ public function analyseFile(
223221
$fileErrors[] = (new Error($e->getMessage(), $file, null, $e, null, null, $e->getTip()))->withIdentifier('phpstan.internal');
224222
} catch (IdentifierNotFound $e) {
225223
$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'))->withIdentifier('phpstan.reflection');
226-
} catch (UnableToCompileNode | NotAClassReflection | NotAnInterfaceReflection | CircularReference $e) {
224+
} catch (UnableToCompileNode | CircularReference $e) {
227225
$fileErrors[] = (new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, null, $e))->withIdentifier('phpstan.reflection');
228226
}
229227
} 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'))->withIdentifier('phpstan.reflection');
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))->withIdentifier('phpstan.reflection');
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'))->withIdentifier('phpstan.reflection');
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))->withIdentifier('phpstan.reflection');
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)