Skip to content

Commit a31cb41

Browse files
committed
src: phpfmt -w .
1 parent 37b38c8 commit a31cb41

1,467 files changed

Lines changed: 7498 additions & 10468 deletions

File tree

Some content is hidden

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

src/AnalysedCodeException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan;
44

55
use Exception;
66

77
abstract class AnalysedCodeException extends Exception
88
{
9-
109
abstract public function getTip(): ?string;
11-
1210
}

src/Analyser/Analyser.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

@@ -20,7 +20,6 @@
2020
#[AutowiredService]
2121
final class Analyser
2222
{
23-
2423
public function __construct(
2524
private FileAnalyser $fileAnalyser,
2625
private RuleRegistry $ruleRegistry,
@@ -110,7 +109,7 @@ public function analyse(
110109
$errors[] = (new Error($t->getMessage(), $file, canBeIgnored: $t))
111110
->withIdentifier('phpstan.internal')
112111
->withMetadata([
113-
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($t),
112+
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($t),
114113
InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $t->getTraceAsString(),
115114
]);
116115
if ($internalErrorsCount >= $this->internalErrorsCountLimit) {
@@ -142,5 +141,4 @@ public function analyse(
142141
memory_get_peak_usage(true),
143142
);
144143
}
145-
146144
}

src/Analyser/AnalyserResult.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

@@ -12,21 +12,20 @@
1212
*/
1313
final class AnalyserResult
1414
{
15-
1615
/** @var list<Error>|null */
1716
private ?array $errors = null;
1817

1918
/**
20-
* @param list<Error> $unorderedErrors
21-
* @param list<Error> $filteredPhpErrors
22-
* @param list<Error> $allPhpErrors
23-
* @param list<Error> $locallyIgnoredErrors
24-
* @param array<string, LinesToIgnore> $linesToIgnore
25-
* @param array<string, LinesToIgnore> $unmatchedLineIgnores
26-
* @param CollectorData $collectedData
27-
* @param list<InternalError> $internalErrors
28-
* @param array<string, array<string>>|null $dependencies
29-
* @param array<string, array<string>>|null $usedTraitDependencies
19+
* @param list<Error> $unorderedErrors
20+
* @param list<Error> $filteredPhpErrors
21+
* @param list<Error> $allPhpErrors
22+
* @param list<Error> $locallyIgnoredErrors
23+
* @param array<string, LinesToIgnore> $linesToIgnore
24+
* @param array<string, LinesToIgnore> $unmatchedLineIgnores
25+
* @param CollectorData $collectedData
26+
* @param list<InternalError> $internalErrors
27+
* @param array<string, array<string>>|null $dependencies
28+
* @param array<string, array<string>>|null $usedTraitDependencies
3029
* @param array<string, array<RootExportedNode>> $exportedNodes
3130
*/
3231
public function __construct(
@@ -64,7 +63,7 @@ public function getErrors(): array
6463
$this->errors = $this->unorderedErrors;
6564
usort(
6665
$this->errors,
67-
static fn (Error $a, Error $b): int => [
66+
static fn(Error $a, Error $b): int => [
6867
$a->getFile(),
6968
$a->getLine(),
7069
$a->getMessage(),
@@ -168,5 +167,4 @@ public function getPeakMemoryUsageBytes(): int
168167
{
169168
return $this->peakMemoryUsageBytes;
170169
}
171-
172170
}

src/Analyser/AnalyserResultFinalizer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

@@ -19,7 +19,6 @@
1919
#[AutowiredService]
2020
final class AnalyserResultFinalizer
2121
{
22-
2322
public function __construct(
2423
private RuleRegistry $ruleRegistry,
2524
private IgnoreErrorExtensionProvider $ignoreErrorExtensionProvider,
@@ -57,23 +56,23 @@ public function finalize(AnalyserResult $analyserResult, bool $onlyFiles, bool $
5756
$tempCollectorErrors[] = (new Error($e->getMessage(), $file, $node->getStartLine(), $e, tip: $e->getTip()))
5857
->withIdentifier('phpstan.internal')
5958
->withMetadata([
60-
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
59+
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
6160
InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $e->getTraceAsString(),
6261
]);
6362
continue;
6463
} catch (IdentifierNotFound $e) {
6564
$tempCollectorErrors[] = (new Error(sprintf('Reflection error: %s not found.', $e->getIdentifier()->getName()), $file, $node->getStartLine(), $e, tip: 'Learn more at https://phpstan.org/user-guide/discovering-symbols'))
6665
->withIdentifier('phpstan.reflection')
6766
->withMetadata([
68-
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
67+
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
6968
InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $e->getTraceAsString(),
7069
]);
7170
continue;
7271
} catch (UnableToCompileNode | CircularReference $e) {
7372
$tempCollectorErrors[] = (new Error(sprintf('Reflection error: %s', $e->getMessage()), $file, $node->getStartLine(), $e))
7473
->withIdentifier('phpstan.reflection')
7574
->withMetadata([
76-
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
75+
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
7776
InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $e->getTraceAsString(),
7877
]);
7978
continue;
@@ -236,5 +235,4 @@ private function addUnmatchedIgnoredErrors(
236235
$locallyIgnoredCollectorErrors,
237236
);
238237
}
239-
240238
}

src/Analyser/ArgumentsNormalizer.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

5-
use PhpParser\Node\Arg;
6-
use PhpParser\Node\Expr\FuncCall;
7-
use PhpParser\Node\Expr\MethodCall;
8-
use PhpParser\Node\Expr\New_;
9-
use PhpParser\Node\Expr\StaticCall;
105
use PHPStan\Node\Expr\TypeExpr;
116
use PHPStan\Reflection\ParametersAcceptor;
127
use PHPStan\Reflection\ParametersAcceptorSelector;
138
use PHPStan\ShouldNotHappenException;
149
use PHPStan\TrinaryLogic;
1510
use PHPStan\Type\Constant\ConstantArrayType;
11+
use PhpParser\Node\Arg;
12+
use PhpParser\Node\Expr\FuncCall;
13+
use PhpParser\Node\Expr\MethodCall;
14+
use PhpParser\Node\Expr\New_;
15+
use PhpParser\Node\Expr\StaticCall;
1616
use function array_key_exists;
1717
use function array_keys;
1818
use function count;
@@ -25,7 +25,6 @@
2525
*/
2626
final class ArgumentsNormalizer
2727
{
28-
2928
public const ORIGINAL_ARG_ATTRIBUTE = 'originalArg';
3029

3130
/**
@@ -182,7 +181,7 @@ public static function reorderNewArguments(
182181
}
183182

184183
/**
185-
* @param Arg[] $callArgs
184+
* @param Arg[] $callArgs
186185
* @return ?array<int, Arg>
187186
*/
188187
public static function reorderArgs(ParametersAcceptor $parametersAcceptor, array $callArgs): ?array
@@ -324,5 +323,4 @@ public static function reorderArgs(ParametersAcceptor $parametersAcceptor, array
324323

325324
return $reorderedArgs;
326325
}
327-
328326
}

src/Analyser/ConditionalExpressionHolder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

@@ -10,7 +10,6 @@
1010

1111
final class ConditionalExpressionHolder
1212
{
13-
1413
/**
1514
* @param array<string, ExpressionTypeHolder> $conditionExpressionTypeHolders
1615
*/
@@ -51,5 +50,4 @@ public function getKey(): string
5150
$this->typeHolder->getCertainty()->describe(),
5251
);
5352
}
54-
5553
}

src/Analyser/ConstantResolver.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

5-
use PhpParser\Node\Name;
65
use PHPStan\DependencyInjection\AutowiredService;
76
use PHPStan\Php\ComposerPhpVersionFactory;
87
use PHPStan\Php\PhpVersion;
@@ -22,27 +21,27 @@
2221
use PHPStan\Type\StringType;
2322
use PHPStan\Type\Type;
2423
use PHPStan\Type\UnionType;
24+
use PhpParser\Node\Name;
25+
use const INF;
26+
use const NAN;
27+
use const PHP_INT_SIZE;
2528
use function array_key_exists;
2629
use function in_array;
2730
use function is_array;
2831
use function is_int;
2932
use function max;
3033
use function sprintf;
31-
use const INF;
32-
use const NAN;
33-
use const PHP_INT_SIZE;
3434

3535
#[AutowiredService(factory: '@PHPStan\Analyser\ConstantResolverFactory::create')]
3636
final class ConstantResolver
3737
{
38-
3938
public const PHP_MIN_ANALYZABLE_VERSION_ID = 50207;
4039

4140
/** @var array<string, true> */
4241
private array $currentlyResolving = [];
4342

4443
/**
45-
* @param string[] $dynamicConstantNames
44+
* @param string[] $dynamicConstantNames
4645
* @param int|array{min: int, max: int}|null $phpVersion
4746
*/
4847
public function __construct(
@@ -119,8 +118,8 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
119118

120119
if (
121120
$minPhpVersion !== null
122-
&& $maxPhpVersion !== null
123-
&& $maxPhpVersion->getMajorVersionId() === $minPhpVersion->getMajorVersionId()
121+
&& $maxPhpVersion !== null
122+
&& $maxPhpVersion->getMajorVersionId() === $minPhpVersion->getMajorVersionId()
124123
) {
125124
$minMinor = $minPhpVersion->getMinorVersionId();
126125
$maxMinor = $maxPhpVersion->getMinorVersionId();
@@ -134,9 +133,9 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
134133

135134
if (
136135
$minPhpVersion !== null
137-
&& $maxPhpVersion !== null
138-
&& $maxPhpVersion->getMajorVersionId() === $minPhpVersion->getMajorVersionId()
139-
&& $maxPhpVersion->getMinorVersionId() === $minPhpVersion->getMinorVersionId()
136+
&& $maxPhpVersion !== null
137+
&& $maxPhpVersion->getMajorVersionId() === $minPhpVersion->getMajorVersionId()
138+
&& $maxPhpVersion->getMinorVersionId() === $minPhpVersion->getMinorVersionId()
140139
) {
141140
$minRelease = $minPhpVersion->getPatchVersionId();
142141
$maxRelease = $maxPhpVersion->getPatchVersionId();
@@ -439,5 +438,4 @@ private function getReflectionProvider(): ReflectionProvider
439438
{
440439
return $this->reflectionProviderProvider->getReflectionProvider();
441440
}
442-
443441
}

src/Analyser/ConstantResolverFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

@@ -10,7 +10,6 @@
1010
#[AutowiredService]
1111
final class ConstantResolverFactory
1212
{
13-
1413
public function __construct(
1514
private ReflectionProviderProvider $reflectionProviderProvider,
1615
private Container $container,
@@ -29,5 +28,4 @@ public function create(): ConstantResolver
2928
$composerFactory,
3029
);
3130
}
32-
3331
}

src/Analyser/DirectInternalScopeFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

@@ -16,7 +16,6 @@
1616

1717
final class DirectInternalScopeFactory implements InternalScopeFactory
1818
{
19-
2019
/**
2120
* @param int|array{min: int, max: int}|null $configPhpVersion
2221
*/
@@ -92,5 +91,4 @@ public function create(
9291
$nativeTypesPromoted,
9392
);
9493
}
95-
9694
}

src/Analyser/EndStatementResult.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<?php declare(strict_types = 1);
1+
<?php declare(strict_types=1);
22

33
namespace PHPStan\Analyser;
44

55
use PhpParser\Node\Stmt;
66

77
final class EndStatementResult
88
{
9-
109
public function __construct(
1110
private Stmt $statement,
1211
private StatementResult $result,
@@ -23,5 +22,4 @@ public function getResult(): StatementResult
2322
{
2423
return $this->result;
2524
}
26-
2725
}

0 commit comments

Comments
 (0)