Skip to content

Commit 38bef53

Browse files
committed
Auto-apply #[Override] fixes
1 parent 98ed732 commit 38bef53

File tree

141 files changed

+388
-0
lines changed

Some content is hidden

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

141 files changed

+388
-0
lines changed

src/Analyser/Error.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Exception;
66
use JsonSerializable;
77
use Nette\Utils\Strings;
8+
use Override;
89
use PhpParser\Node;
910
use PHPStan\ShouldNotHappenException;
1011
use ReturnTypeWillChange;
@@ -264,6 +265,7 @@ public function getFixedErrorDiff(): ?FixedErrorDiff
264265
* @return mixed
265266
*/
266267
#[ReturnTypeWillChange]
268+
#[Override]
267269
public function jsonSerialize()
268270
{
269271
$fixedErrorDiffHash = null;

src/Analyser/InternalError.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Analyser;
44

55
use JsonSerializable;
6+
use Override;
67
use ReturnTypeWillChange;
78
use Throwable;
89
use function array_map;
@@ -90,6 +91,7 @@ public static function decode(array $json): self
9091
* @return mixed
9192
*/
9293
#[ReturnTypeWillChange]
94+
#[Override]
9395
public function jsonSerialize()
9496
{
9597
return [

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use ArrayAccess;
66
use Closure;
77
use DivisionByZeroError;
8+
use Override;
89
use PhpParser\Comment\Doc;
910
use PhpParser\Modifiers;
1011
use PhpParser\Node;
@@ -1880,6 +1881,7 @@ private function processStmtNode(
18801881
$traverser = new NodeTraverser();
18811882
$traverser->addVisitor(new class () extends NodeVisitorAbstract {
18821883

1884+
#[Override]
18831885
public function leaveNode(Node $node): ?ExistingArrayDimFetch
18841886
{
18851887
if (!$node instanceof ArrayDimFetch || $node->dim === null) {

src/Collectors/CollectedData.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Collectors;
44

55
use JsonSerializable;
6+
use Override;
67
use PhpParser\Node;
78
use ReturnTypeWillChange;
89

@@ -53,6 +54,7 @@ public function getCollectorType(): string
5354
* @return mixed
5455
*/
5556
#[ReturnTypeWillChange]
57+
#[Override]
5658
public function jsonSerialize()
5759
{
5860
return [

src/Command/AnalyseCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Command;
44

55
use OndraM\CiDetector\CiDetector;
6+
use Override;
67
use PHPStan\Analyser\InternalError;
78
use PHPStan\Command\ErrorFormatter\BaselineNeonErrorFormatter;
89
use PHPStan\Command\ErrorFormatter\BaselinePhpErrorFormatter;
@@ -85,6 +86,7 @@ public function __construct(
8586
parent::__construct();
8687
}
8788

89+
#[Override]
8890
protected function configure(): void
8991
{
9092
$this->setName(self::NAME)
@@ -113,11 +115,13 @@ protected function configure(): void
113115
/**
114116
* @return string[]
115117
*/
118+
#[Override]
116119
public function getAliases(): array
117120
{
118121
return ['analyze'];
119122
}
120123

124+
#[Override]
121125
protected function initialize(InputInterface $input, OutputInterface $output): void
122126
{
123127
if ((bool) $input->getOption('debug')) {
@@ -130,6 +134,7 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
130134
}
131135
}
132136

137+
#[Override]
133138
protected function execute(InputInterface $input, OutputInterface $output): int
134139
{
135140
$paths = $input->getArgument('paths');

src/Command/ClearResultCacheCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace PHPStan\Command;
44

5+
use Override;
56
use PHPStan\Analyser\ResultCache\ResultCacheClearer;
67
use PHPStan\ShouldNotHappenException;
78
use Symfony\Component\Console\Command\Command;
@@ -26,6 +27,7 @@ public function __construct(
2627
parent::__construct();
2728
}
2829

30+
#[Override]
2931
protected function configure(): void
3032
{
3133
$this->setName(self::NAME)
@@ -39,6 +41,7 @@ protected function configure(): void
3941
]);
4042
}
4143

44+
#[Override]
4245
protected function initialize(InputInterface $input, OutputInterface $output): void
4346
{
4447
if ((bool) $input->getOption('debug')) {
@@ -51,6 +54,7 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
5154
}
5255
}
5356

57+
#[Override]
5458
protected function execute(InputInterface $input, OutputInterface $output): int
5559
{
5660
$autoloadFile = $input->getOption('autoload-file');

src/Command/DiagnoseCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace PHPStan\Command;
44

5+
use Override;
56
use PHPStan\Diagnose\DiagnoseExtension;
67
use PHPStan\Diagnose\PHPStanDiagnoseExtension;
78
use PHPStan\ShouldNotHappenException;
@@ -26,6 +27,7 @@ public function __construct(
2627
parent::__construct();
2728
}
2829

30+
#[Override]
2931
protected function configure(): void
3032
{
3133
$this->setName(self::NAME)
@@ -39,6 +41,7 @@ protected function configure(): void
3941
]);
4042
}
4143

44+
#[Override]
4245
protected function initialize(InputInterface $input, OutputInterface $output): void
4346
{
4447
if ((bool) $input->getOption('debug')) {
@@ -51,6 +54,7 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
5154
}
5255
}
5356

57+
#[Override]
5458
protected function execute(InputInterface $input, OutputInterface $output): int
5559
{
5660
$memoryLimit = $input->getOption('memory-limit');

src/Command/DumpParametersCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Nette\Neon\Neon;
66
use Nette\Utils\Json;
7+
use Override;
78
use PHPStan\ShouldNotHappenException;
89
use Symfony\Component\Console\Command\Command;
910
use Symfony\Component\Console\Input\InputInterface;
@@ -26,6 +27,7 @@ public function __construct(
2627
parent::__construct();
2728
}
2829

30+
#[Override]
2931
protected function configure(): void
3032
{
3133
$this->setName(self::NAME)
@@ -40,6 +42,7 @@ protected function configure(): void
4042
]);
4143
}
4244

45+
#[Override]
4346
protected function initialize(InputInterface $input, OutputInterface $output): void
4447
{
4548
if ((bool) $input->getOption('debug')) {
@@ -52,6 +55,7 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
5255
}
5356
}
5457

58+
#[Override]
5559
protected function execute(InputInterface $input, OutputInterface $output): int
5660
{
5761
$memoryLimit = $input->getOption('memory-limit');

src/Command/ErrorsConsoleStyle.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Command;
44

55
use OndraM\CiDetector\CiDetector;
6+
use Override;
67
use Symfony\Component\Console\Helper\ProgressBar;
78
use Symfony\Component\Console\Helper\TableSeparator;
89
use Symfony\Component\Console\Input\InputInterface;
@@ -49,6 +50,7 @@ private function isCiDetected(): bool
4950
* @param string[] $headers
5051
* @param string[][] $rows
5152
*/
53+
#[Override]
5254
public function table(array $headers, array $rows): void
5355
{
5456
/** @var int $terminalWidth */
@@ -129,6 +131,7 @@ private function wrap(array $rows, int $terminalWidth, int $maxHeaderWidth): arr
129131
return $rows;
130132
}
131133

134+
#[Override]
132135
public function createProgressBar(int $max = 0): ProgressBar
133136
{
134137
$this->progressBar = parent::createProgressBar($max);
@@ -180,6 +183,7 @@ private function getProgressBarFormat(): ?string
180183
return ProgressBar::getFormatDefinition($formatName);
181184
}
182185

186+
#[Override]
183187
public function progressStart(int $max = 0): void
184188
{
185189
if (!$this->showProgress) {
@@ -188,6 +192,7 @@ public function progressStart(int $max = 0): void
188192
parent::progressStart($max);
189193
}
190194

195+
#[Override]
191196
public function progressAdvance(int $step = 1): void
192197
{
193198
if (!$this->showProgress) {
@@ -197,6 +202,7 @@ public function progressAdvance(int $step = 1): void
197202
parent::progressAdvance($step);
198203
}
199204

205+
#[Override]
200206
public function progressFinish(): void
201207
{
202208
if (!$this->showProgress) {

src/Command/FixerWorkerCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Command;
44

55
use Clue\React\NDJson\Encoder;
6+
use Override;
67
use PHPStan\Analyser\AnalyserResult;
78
use PHPStan\Analyser\AnalyserResultFinalizer;
89
use PHPStan\Analyser\Error;
@@ -57,6 +58,7 @@ public function __construct(
5758
parent::__construct();
5859
}
5960

61+
#[Override]
6062
protected function configure(): void
6163
{
6264
$this->setName(self::NAME)
@@ -73,6 +75,7 @@ protected function configure(): void
7375
->setHidden(true);
7476
}
7577

78+
#[Override]
7679
protected function execute(InputInterface $input, OutputInterface $output): int
7780
{
7881
$paths = $input->getArgument('paths');

src/Command/WorkerCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Clue\React\NDJson\Decoder;
66
use Clue\React\NDJson\Encoder;
7+
use Override;
78
use PHPStan\Analyser\FileAnalyser;
89
use PHPStan\Analyser\InternalError;
910
use PHPStan\Analyser\NodeScopeResolver;
@@ -52,6 +53,7 @@ public function __construct(
5253
parent::__construct();
5354
}
5455

56+
#[Override]
5557
protected function configure(): void
5658
{
5759
$this->setName(self::NAME)
@@ -71,6 +73,7 @@ protected function configure(): void
7173
->setHidden(true);
7274
}
7375

76+
#[Override]
7477
protected function execute(InputInterface $input, OutputInterface $output): int
7578
{
7679
$paths = $input->getArgument('paths');

src/Dependency/ExportedNode/ExportedAttributeNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Dependency\ExportedNode;
44

55
use JsonSerializable;
6+
use Override;
67
use PHPStan\Dependency\ExportedNode;
78
use ReturnTypeWillChange;
89
use function count;
@@ -58,6 +59,7 @@ public static function __set_state(array $properties): self
5859
* @return mixed
5960
*/
6061
#[ReturnTypeWillChange]
62+
#[Override]
6163
public function jsonSerialize()
6264
{
6365
return [

src/Dependency/ExportedNode/ExportedClassConstantNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Dependency\ExportedNode;
44

55
use JsonSerializable;
6+
use Override;
67
use PHPStan\Dependency\ExportedNode;
78
use PHPStan\ShouldNotHappenException;
89
use ReturnTypeWillChange;
@@ -76,6 +77,7 @@ public static function decode(array $data): self
7677
* @return mixed
7778
*/
7879
#[ReturnTypeWillChange]
80+
#[Override]
7981
public function jsonSerialize()
8082
{
8183
return [

src/Dependency/ExportedNode/ExportedClassConstantsNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Dependency\ExportedNode;
44

55
use JsonSerializable;
6+
use Override;
67
use PHPStan\Dependency\ExportedNode;
78
use PHPStan\ShouldNotHappenException;
89
use ReturnTypeWillChange;
@@ -89,6 +90,7 @@ public static function decode(array $data): self
8990
* @return mixed
9091
*/
9192
#[ReturnTypeWillChange]
93+
#[Override]
9294
public function jsonSerialize()
9395
{
9496
return [

src/Dependency/ExportedNode/ExportedClassNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Dependency\ExportedNode;
44

55
use JsonSerializable;
6+
use Override;
67
use PHPStan\Dependency\ExportedNode;
78
use PHPStan\Dependency\RootExportedNode;
89
use PHPStan\ShouldNotHappenException;
@@ -117,6 +118,7 @@ public static function __set_state(array $properties): self
117118
* @return mixed
118119
*/
119120
#[ReturnTypeWillChange]
121+
#[Override]
120122
public function jsonSerialize()
121123
{
122124
return [

src/Dependency/ExportedNode/ExportedEnumCaseNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Dependency\ExportedNode;
44

55
use JsonSerializable;
6+
use Override;
67
use PHPStan\Dependency\ExportedNode;
78
use ReturnTypeWillChange;
89

@@ -63,6 +64,7 @@ public static function decode(array $data): self
6364
* @return mixed
6465
*/
6566
#[ReturnTypeWillChange]
67+
#[Override]
6668
public function jsonSerialize()
6769
{
6870
return [

src/Dependency/ExportedNode/ExportedEnumNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Dependency\ExportedNode;
44

55
use JsonSerializable;
6+
use Override;
67
use PHPStan\Dependency\ExportedNode;
78
use PHPStan\Dependency\RootExportedNode;
89
use PHPStan\ShouldNotHappenException;
@@ -93,6 +94,7 @@ public static function __set_state(array $properties): self
9394
* @return mixed
9495
*/
9596
#[ReturnTypeWillChange]
97+
#[Override]
9698
public function jsonSerialize()
9799
{
98100
return [

0 commit comments

Comments
 (0)