mirror of
https://github.com/danog/Valinor.git
synced 2024-11-26 20:24:40 +01:00
69ad3f4777
The cache implementation that was previously injected in the mapper builder must now be manually injected. This gives better control on when the cache should be enabled, especially depending on which environment the application is running. The library provides a cache implementation out of the box, which saves cache entries into the file system. It is also possible to use any PSR-16 compliant implementation, as long as it is capable of caching the entries handled by the library. ```php $cache = new \CuyZ\Valinor\Cache\FileSystemCache('path/to/cache-dir'); (new \CuyZ\Valinor\MapperBuilder()) ->withCache($cache) ->mapper() ->map(SomeClass::class, [/* … */]); ```
34 lines
1.4 KiB
Plaintext
34 lines
1.4 KiB
Plaintext
includes:
|
|
- qa/PHPStan/valinor-phpstan-configuration.php
|
|
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
|
- vendor/phpstan/phpstan-phpunit/extension.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
|
|
|
|
- message: '#Method CuyZ\\Valinor\\MapperBuilder::withCache\(\) has parameter \$cache with generic interface Psr\\SimpleCache\\\CacheInterface but does not specify its types: EntryType#'
|
|
path: src/MapperBuilder.php
|
|
|
|
stubFiles:
|
|
- qa/PHPStan/Stubs/Psr/SimpleCache/CacheInterface.stub
|
|
tmpDir: var/cache/phpstan
|