Skip to content

Commit 4ef5cca

Browse files
AJenboondrejmirtes
authored andcommitted
Remove unused variables
1 parent 7db4be0 commit 4ef5cca

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎build/PHPStan/Build/TurboAttributeCollector.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function collect(): array
223223
ksort($referenced);
224224

225225
$manifest = [];
226-
foreach ($pairs as $className => [$turboClass, $final, $cppFile]) {
226+
foreach ($pairs as $className => [, , $cppFile]) {
227227
$fileName = (new ReflectionClass($className))->getFileName();
228228
if ($fileName === false) {
229229
throw new RuntimeException(sprintf('%s has no source file', $className));
@@ -272,7 +272,7 @@ private static function collectInterfaceFiles(string $interface, array &$files):
272272
public function renderStubs(array $pairs): string
273273
{
274274
$namespaces = [];
275-
foreach ($pairs as $className => [$turboClass, $final, $cppFile, $interfaces]) {
275+
foreach ($pairs as $className => [$turboClass, $final, , $interfaces]) {
276276
$pos = strrpos($className, '\\');
277277
if ($pos === false) {
278278
throw new RuntimeException(sprintf('%s is not a namespaced class name', $className));

‎src/Analyser/ExprHandler/Helper/ConditionalExpressionHolderHelper.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ public function buildBranchUnionAugment(
5252
): ?DisjunctionBranchUnionAugment
5353
{
5454
$candidateExprs = [];
55-
foreach ($leftTypes->getSureTypes() as $exprString => [$exprNode, $type]) {
55+
foreach ($leftTypes->getSureTypes() as $exprString => [$exprNode]) {
5656
$candidateExprs[$exprString] = $exprNode;
5757
}
58-
foreach ($rightTypes->getSureTypes() as $exprString => [$exprNode, $type]) {
58+
foreach ($rightTypes->getSureTypes() as $exprString => [$exprNode]) {
5959
$candidateExprs[$exprString] = $exprNode;
6060
}
6161
// sureNot entries constrain their branch too - the old normalize()
@@ -64,10 +64,10 @@ public function buildBranchUnionAugment(
6464
// contribute its subject. The branch-scope reads below price the subject
6565
// on each filtered scope, where an impossible branch (a holder-fixpoint
6666
// contradiction) collapses to never and drops out of the union.
67-
foreach ($leftTypes->getSureNotTypes() as $exprString => [$exprNode, $type]) {
67+
foreach ($leftTypes->getSureNotTypes() as $exprString => [$exprNode]) {
6868
$candidateExprs[$exprString] = $exprNode;
6969
}
70-
foreach ($rightTypes->getSureNotTypes() as $exprString => [$exprNode, $type]) {
70+
foreach ($rightTypes->getSureNotTypes() as $exprString => [$exprNode]) {
7171
$candidateExprs[$exprString] = $exprNode;
7272
}
7373

‎src/Analyser/ExprHandler/MatchHandler.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function supports(Expr $expr): bool
7171
public function resolveType(MutatingScope $scope, Expr $expr): Type
7272
{
7373
$types = [];
74-
foreach ($this->getArmScopesAndTypes($scope, $expr) as [$armScope, $armType]) {
74+
foreach ($this->getArmScopesAndTypes($scope, $expr) as [, $armType]) {
7575
$types[] = $armType;
7676
}
7777

‎src/Analyser/MutatingScope.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ public function getClosureScopeCacheKey(?array $relevantRoots = null): string
11201120
$parts[] = '---';
11211121

11221122
$parts[] = sprintf(':%d', count($this->inFunctionCallsStack));
1123-
foreach ($this->inFunctionCallsStack as [$method, $parameter]) {
1123+
foreach ($this->inFunctionCallsStack as [, $parameter]) {
11241124
if ($parameter === null) {
11251125
$parts[] = ',null';
11261126
continue;

‎src/Command/AnalyseCommand.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
202202
$insteadOfFile,
203203
true,
204204
);
205-
} catch (InceptionNotSuccessfulException $e) {
205+
} catch (InceptionNotSuccessfulException) {
206206
return 1;
207207
}
208208

‎src/Command/WorkerCommand.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
101101
$insteadOfFile,
102102
false,
103103
);
104-
} catch (InceptionNotSuccessfulException $e) {
104+
} catch (InceptionNotSuccessfulException) {
105105
return 1;
106106
}
107107

‎src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocatorFactory.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private function createCachedDirectorySourceLocator(array $fileHashes, string $c
186186
$cacheModified = false;
187187
$findInFiles = [];
188188
if ($cached !== null) {
189-
foreach ($cached as $file => [$hash, $classes, $functions, $constants]) {
189+
foreach ($cached as $file => [$hash]) {
190190
if (!array_key_exists($file, $fileHashes)) {
191191
unset($cached[$file]);
192192
$cacheModified = true;

0 commit comments

Comments
 (0)