Skip to content

Commit a955607

Browse files
authored
chore: remove dead code (#8896)
1 parent 0e970f0 commit a955607

File tree

11 files changed

+46
-76
lines changed

11 files changed

+46
-76
lines changed

dev-tools/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"phpstan/phpstan-phpunit": "^2.0.7",
1616
"phpstan/phpstan-strict-rules": "^2.0.6",
1717
"phpstan/phpstan-symfony": "^2.0.7",
18+
"shipmonk/dead-code-detector": "^0.13.0",
1819
"shipmonk/phpstan-baseline-per-identifier": "^2.1.6"
1920
},
2021
"config": {

dev-tools/composer.lock

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

phpstan.dist.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ parameters:
5858
-
5959
message: '/^Property PhpCsFixer\\Console\\Command\\\w+Command::\$default(?:Name|Description) has no type specified\.$/'
6060
identifier: missingType.property
61+
-
62+
message: '/^Unused PhpCsFixer\\[a-zA-Z\\]+Interface::[a-zA-Z]+$/'
63+
path: src
64+
count: 17
6165
tipsOfTheDay: false
6266
symfony:
6367
consoleApplicationLoader: dev-tools/phpstan/console-application.php

src/Doctrine/Annotation/Tokens.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,6 @@ public function getNextMeaningfulToken(int $index): ?int
168168
return $this->getMeaningfulTokenSibling($index, 1);
169169
}
170170

171-
/**
172-
* Returns the index of the closest previous token that is neither a comment nor a whitespace token.
173-
*/
174-
public function getPreviousMeaningfulToken(int $index): ?int
175-
{
176-
return $this->getMeaningfulTokenSibling($index, -1);
177-
}
178-
179171
/**
180172
* Returns the index of the last token that is part of the annotation at the given index.
181173
*/

src/Runner/Event/FileProcessed.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,14 @@ final class FileProcessed extends Event
4242
*/
4343
private int $status;
4444

45-
private ?string $fileRelativePath;
4645
private ?string $fileHash;
4746

4847
/**
4948
* @param self::STATUS_* $status
5049
*/
51-
public function __construct(int $status, ?string $fileRelativePath = null, ?string $fileHash = null)
50+
public function __construct(int $status, ?string $fileHash = null)
5251
{
5352
$this->status = $status;
54-
$this->fileRelativePath = $fileRelativePath;
5553
$this->fileHash = $fileHash;
5654
}
5755

@@ -63,11 +61,6 @@ public function getStatus(): int
6361
return $this->status;
6462
}
6563

66-
public function getFileRelativePath(): ?string
67-
{
68-
return $this->fileRelativePath;
69-
}
70-
7164
public function getFileHash(): ?string
7265
{
7366
return $this->fileHash;

src/Runner/Runner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu
535535

536536
$this->dispatchEvent(
537537
FileProcessed::NAME,
538-
new FileProcessed(null !== $fixInfo ? FileProcessed::STATUS_FIXED : FileProcessed::STATUS_NO_CHANGES, $filePathname, $newHash)
538+
new FileProcessed(null !== $fixInfo ? FileProcessed::STATUS_FIXED : FileProcessed::STATUS_NO_CHANGES, $newHash)
539539
);
540540

541541
return $fixInfo;

src/Tokenizer/Analyzer/Analysis/NamespaceAnalysis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* @internal
2121
*/
22-
final class NamespaceAnalysis implements StartEndTokenAwareAnalysis
22+
final class NamespaceAnalysis
2323
{
2424
/**
2525
* The fully qualified namespace name.

src/Tokenizer/Analyzer/Analysis/NamespaceUseAnalysis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @author VeeWee <[email protected]>
2525
* @author Greg Korba <[email protected]>
2626
*/
27-
final class NamespaceUseAnalysis implements StartEndTokenAwareAnalysis
27+
final class NamespaceUseAnalysis
2828
{
2929
public const TYPE_CLASS = 1; // "classy" could be class, interface or trait
3030
public const TYPE_FUNCTION = 2;

src/Tokenizer/Analyzer/Analysis/StartEndTokenAwareAnalysis.php

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

src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* @internal
2121
*/
22-
final class TypeAnalysis implements StartEndTokenAwareAnalysis
22+
final class TypeAnalysis
2323
{
2424
/**
2525
* This list contains soft and hard reserved types that can be used or will be used by PHP at some point.

0 commit comments

Comments
 (0)