Skip to content

Commit e45df95

Browse files
zonuexephpstan-bot
authored andcommitted
Trivial code style fixes (phpstan#5159)
1 parent e86b8a6 commit e45df95

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

src/Analyser/Ignore/IgnoredErrorHelperResult.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ public function process(
200200
continue;
201201
}
202202
if (
203-
isset($unmatchedIgnoredError['count'])
204-
&& isset($unmatchedIgnoredError['realCount'])
203+
isset($unmatchedIgnoredError['count'], $unmatchedIgnoredError['realCount'])
205204
&& (isset($unmatchedIgnoredError['realPath']) || !$onlyFiles)
206205
) {
207206
if ($unmatchedIgnoredError['realCount'] < $unmatchedIgnoredError['count']) {

src/Reflection/InitializerExprTypeResolver.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,9 +1549,7 @@ public function getPlusTypeFromTypes(Expr $left, Expr $right, Type $leftType, Ty
15491549
}
15501550

15511551
if ($leftType instanceof MixedType && $rightType instanceof MixedType) {
1552-
if (
1553-
($leftIsArray->no() && $rightIsArray->no())
1554-
) {
1552+
if ($leftIsArray->no() && $rightIsArray->no()) {
15551553
return new BenevolentUnionType([
15561554
new FloatType(),
15571555
new IntegerType(),

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function findSpecifiedType(
9797
return null;
9898
} elseif ($functionName === 'in_array' && $argsCount >= 2) {
9999
$haystackArg = $args[1]->value;
100-
$haystackType = ($this->treatPhpDocTypesAsCertain ? $scope->getType($haystackArg) : $scope->getNativeType($haystackArg));
100+
$haystackType = $this->treatPhpDocTypesAsCertain ? $scope->getType($haystackArg) : $scope->getNativeType($haystackArg);
101101
if ($haystackType instanceof MixedType) {
102102
return null;
103103
}
@@ -107,7 +107,7 @@ public function findSpecifiedType(
107107
}
108108

109109
$needleArg = $args[0]->value;
110-
$needleType = ($this->treatPhpDocTypesAsCertain ? $scope->getType($needleArg) : $scope->getNativeType($needleArg));
110+
$needleType = $this->treatPhpDocTypesAsCertain ? $scope->getType($needleArg) : $scope->getNativeType($needleArg);
111111

112112
$isStrictComparison = false;
113113
if ($argsCount >= 3) {
@@ -198,7 +198,7 @@ public function findSpecifiedType(
198198
}
199199
} elseif ($functionName === 'method_exists' && $argsCount >= 2) {
200200
$objectArg = $args[0]->value;
201-
$objectType = ($this->treatPhpDocTypesAsCertain ? $scope->getType($objectArg) : $scope->getNativeType($objectArg));
201+
$objectType = $this->treatPhpDocTypesAsCertain ? $scope->getType($objectArg) : $scope->getNativeType($objectArg);
202202

203203
if ($objectType instanceof ConstantStringType
204204
&& !$this->reflectionProvider->hasClass($objectType->getValue())
@@ -207,7 +207,7 @@ public function findSpecifiedType(
207207
}
208208

209209
$methodArg = $args[1]->value;
210-
$methodType = ($this->treatPhpDocTypesAsCertain ? $scope->getType($methodArg) : $scope->getNativeType($methodArg));
210+
$methodType = $this->treatPhpDocTypesAsCertain ? $scope->getType($methodArg) : $scope->getNativeType($methodArg);
211211

212212
if ($methodType instanceof ConstantStringType) {
213213
if ($objectType instanceof ConstantStringType) {
@@ -273,7 +273,7 @@ public function findSpecifiedType(
273273
return null;
274274
}
275275

276-
$rootExprType = ($this->treatPhpDocTypesAsCertain ? $scope->getType($rootExpr) : $scope->getNativeType($rootExpr));
276+
$rootExprType = $this->treatPhpDocTypesAsCertain ? $scope->getType($rootExpr) : $scope->getNativeType($rootExpr);
277277
if ($rootExprType instanceof ConstantBooleanType) {
278278
return $rootExprType->getValue();
279279
}

src/Rules/Methods/MethodParameterComparisonHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ public function compare(ExtendedMethodReflection $prototype, ClassReflection $pr
355355
}
356356

357357
$messages[] = $error->build();
358-
359-
continue;
360358
}
361359

362360
return $messages;

0 commit comments

Comments
 (0)