Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ parameters:
count: 1
path: ../src/Diagnose/PHPStanDiagnoseExtension.php
- identifier: ternary.shortNotAllowed
-
# operators take the configured PHP version, like InitializerExprTypeResolver does;
# not ignored inline because PHP 7.4 reads the class attribute as a comment,
# so the error is on a different line there
identifier: phpstan.phpVersionInjection
path: ../src/Type/Php/IntdivFunctionReturnTypeExtension.php
-
identifier: shipmonk.deadMethod
path: ../src/Internal/CombinationsHelper.php
Expand Down
128 changes: 61 additions & 67 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -427,46 +427,10 @@ parameters:
count: 1
path: src/Reflection/ClassReflection.php

-
rawMessage: Binary operation "&" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: Binary operation "*" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: Binary operation "+" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: Binary operation "-" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: Binary operation "^" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: Binary operation "|" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: 'Doing instanceof PHPStan\Type\ConstantScalarType is error-prone and deprecated. Use Type::isConstantScalarValue() or Type::getConstantScalarTypes() or Type::getConstantScalarValues() instead.'
identifier: phpstanApi.instanceofType
count: 18
count: 2
path: src/Reflection/InitializerExprTypeResolver.php

-
Expand All @@ -481,30 +445,6 @@ parameters:
count: 3
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
identifier: phpstanApi.instanceofType
count: 6
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: PHPDoc tag @var with type float|int is not subtype of native type int.
identifier: varTag.nativeType
count: 1
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: PHPDoc tag @var with type float|int is not subtype of type int.
identifier: varTag.type
count: 4
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: PHPDoc tag @var with type float|int|null is not subtype of type int|null.
identifier: varTag.type
count: 6
path: src/Reflection/InitializerExprTypeResolver.php

-
rawMessage: Creating new PHPStan\Php8StubsMap is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
identifier: phpstanApi.constructor
Expand Down Expand Up @@ -1375,12 +1315,6 @@ parameters:
count: 3
path: src/Type/Generic/TemplateUnionType.php

-
rawMessage: 'Doing instanceof PHPStan\Type\ConstantScalarType is error-prone and deprecated. Use Type::isConstantScalarValue() or Type::getConstantScalarTypes() or Type::getConstantScalarValues() instead.'
identifier: phpstanApi.instanceofType
count: 1
path: src/Type/IntegerRangeType.php

-
rawMessage: 'Doing instanceof PHPStan\Type\IntegerType is error-prone and deprecated. Use Type::isInteger() instead.'
identifier: phpstanApi.instanceofType
Expand Down Expand Up @@ -1513,6 +1447,66 @@ parameters:
count: 4
path: src/Type/ObjectWithoutClassType.php

-
rawMessage: Binary operation "&" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: Binary operation "*" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: Binary operation "+" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: Binary operation "-" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: Binary operation "^" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: Binary operation "|" between bool|float|int|string|null and bool|float|int|string|null results in an error.
identifier: binaryOp.invalid
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: 'Doing instanceof PHPStan\Type\ConstantScalarType is error-prone and deprecated. Use Type::isConstantScalarValue() or Type::getConstantScalarTypes() or Type::getConstantScalarValues() instead.'
identifier: phpstanApi.instanceofType
count: 16
path: src/Type/OperatorTypeHelper.php

-
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
identifier: phpstanApi.instanceofType
count: 6
path: src/Type/OperatorTypeHelper.php

-
rawMessage: PHPDoc tag @var with type float|int is not subtype of native type int.
identifier: varTag.nativeType
count: 1
path: src/Type/OperatorTypeHelper.php

-
rawMessage: PHPDoc tag @var with type float|int|null is not subtype of type int|null.
identifier: varTag.type
count: 6
path: src/Type/OperatorTypeHelper.php

-
rawMessage: Creating new ReflectionClass is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.
identifier: phpstanApi.runtimeReflection
Expand Down
6 changes: 6 additions & 0 deletions src/Php/PhpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ public function nonNumericStringAndIntegerIsFalseOnLooseComparison(): bool
return $this->versionId >= 80000;
}

// see https://wiki.php.net/rfc/saner-numeric-strings
public function allowsTrailingWhitespaceInNumericStrings(): bool
{
return $this->versionId >= 80000;
}

public function supportsCallableInstanceMethods(): bool
{
return $this->versionId < 80000;
Expand Down
Loading
Loading