hyperf/phpstan.neon.dist
Deeka Wong 718827e8a6
chore: Update phpstan.neon.dist to level 6 (#6780)
Co-authored-by: 李铭昕 <715557344@qq.com>
2024-05-23 11:43:58 +08:00

87 lines
4.2 KiB
Plaintext

# Magic behaviour with __get, __set, __call and __callStatic is not exactly static analyser-friendly :)
# Fortunately, You can ignore it by the following config.
#
parameters:
level: 6
bootstrapFiles:
- "bootstrap.php"
parallel:
jobSize: 20
maximumNumberOfProcesses: 32
minimumNumberOfJobsPerProcess: 2
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: true
reportUnmatchedIgnoredErrors: false
excludePaths:
- %currentWorkingDirectory%/src/helper/*
- %currentWorkingDirectory%/src/*/tests/*
- %currentWorkingDirectory%/src/*/publish/*
- %currentWorkingDirectory%/src/*/class_map/*
- %currentWorkingDirectory%/src/di/src/Resolver/FactoryResolver.php
- %currentWorkingDirectory%/src/config-zookeeper/src/Client.php
- %currentWorkingDirectory%/src/database/*
- %currentWorkingDirectory%/src/database-pgsql/*
- %currentWorkingDirectory%/src/db/src/PgSQL/*
- %currentWorkingDirectory%/src/filesystem/*
- %currentWorkingDirectory%/src/graphql/*
- %currentWorkingDirectory%/src/grpc/*
- %currentWorkingDirectory%/src/grpc-server/*
- %currentWorkingDirectory%/src/ide-helper/*
- %currentWorkingDirectory%/src/validation/*
- %currentWorkingDirectory%/src/view/src/Engine/*
- %currentWorkingDirectory%/src/server/src/SwowServer.php
- %currentWorkingDirectory%/src/amqp/src/IO/SwowIO.php
ignoreErrors:
-
identifier: missingType.iterableValue
-
identifier: missingType.generics
-
identifier: missingType.return
-
identifier: missingType.parameter
- '#Unable to resolve the template type#'
- '#side of && is always#'
- '#method Redis::zRevRangeByScore\(\) expects int, string given#'
- '#Argument of an invalid type Hyperf\\AsyncQueue\\Job supplied for foreach, only iterables are supported#'
- '#Variable .* in isset\(\) always exists and is not nullable#'
- '#Static call to instance method Hyperf\\DbConnection\\Db.*#'
- '#Static call to instance method SplPriorityQueue\:\:insert\(\)#'
- '#Call to an undefined method ReflectionType::getName#'
- '#Call to an undefined method Traversable<mixed, mixed>\:\:getArrayCopy#'
- '#Unsafe usage of new static#'
- '#Method Hyperf\\Contract\\Sendable::send#'
- '#Variable .* in PHPDoc tag @var does not exist#'
- '#Call to an undefined method Hyperf\\Database\\Model\\Model::hydrate#'
- '#PHPDoc tag @param has invalid value#'
- '#Static call to instance method Hyperf\\RpcServer\\Router\\Router::#'
- '#Method Hyperf\\Utils\\Serializer\\ScalarNormalizer::denormalize\(\) should return array\|object but returns#'
- '#Function get_debug_type invoked with 1 parameter, 0 required#'
- '#Call to an undefined method Hyperf\\Utils\\HigherOrderCollectionProxy::.*#'
- '#InfluxDB\\Point constructor expects float\|null, string given#'
- '#separator of function explode expects non-empty-string, string given#'
- '#While loop condition is always true#'
- '#Unsafe access to private property .* through static::#'
- '#Unsafe call to private method .* through static::#'
- '#Property .* is never read, only written#'
- message: '#Match arm is unreachable because previous comparison is always true#'
path: src/amqp/src/IO/IOFactory.php
- '#.*TKey.*TValue#'
- '#Method Hyperf\\Serializer\\Serializer::normalize\(\) should return array\|ArrayObject\|bool\|float\|int\|string\|null#'
- '#Class RedisSentinel constructor invoked with .*#'
- '#Hyperf\\Engine\\Http\\Server#'
- '#Class Hyperf\\Logger\\Logger extends @final class Monolog\\Logger#'
- '#has invalid type Swow#'
- '#has unknown class Swow#'
- '#PHPDoc tag \@var above a method has no effect#'
- '#Call to an undefined method Hyperf\\Collection\\HigherOrderCollectionProxy::\w+\(\)#'
- '#Access to an undefined property Hyperf\\Support\\Fluent#'
- '#Call to an undefined method Hyperf\\Database\\.*\\Grammar::#'
- '#Call to an undefined method Hyperf\\Database\\.*\\Processor::#'
- message: '#Type mixed in generic type.*#'
path: src/collection/*.php
- message: '#Method .* should return .* but returns#'
path: src/collection/src/*.php
- message: '#has no type specified#'
path: src/nacos/src/Protobuf/*.php