Valinor/phpstan.neon.dist
Romain Canon 4267c20423 misc!: mark classes with @internal or @api annotation
This change filters the scope of the public API that is provided by this
library.

Any class or interface that is not explicitly marked with an `@api`
annotation should never be used outside this library — any change can
and will be made without taking breaking changes rules into account.

When a breaking change happens inside the public API scope, a major
version will be released; refer to https://semver.org for more
information.

A new PHPStan extension is now part of the quality assurance process,
ensuring that all classes/interfaces must provide either `@internal` or
`@api` annotation.
2022-01-13 18:23:47 +01:00

30 lines
1.1 KiB
Plaintext

includes:
- qa/PHPStan/valinor-phpstan-configuration.php
- vendor/phpstan/phpstan-strict-rules/rules.neon
rules:
- CuyZ\Valinor\QA\PHPStan\Extension\ApiAndInternalAnnotationCheck
parameters:
level: max
paths:
- src
- tests
- qa/PHPStan
ignoreErrors:
# \PHPStan\Rules\BooleansInConditions
- '#Only booleans are allowed in .* given#'
# \PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule
- '#Short ternary operator is not allowed\. Use null coalesce operator if applicable or consider using long ternary\.#'
# \PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule
- '#Construct empty\(\) is not allowed\. Use more strict comparison\.#'
- '#Method [\w\\:]+_data_provider\(\) return type has no value type specified in iterable type#'
- message: '#Template type T of method CuyZ\\Valinor\\Mapper\\TreeMapper::map\(\) is not referenced in a parameter#'
path: src/Mapper/TreeMapper.php
stubFiles:
- qa/PHPStan/Stubs/Psr/SimpleCache/CacheInterface.stub
tmpDir: var/cache/phpstan