Skip to content

Commit c8ceda6

Browse files
Replace deprecated phpstan option checkGenericClassInNonGenericObjectType by identifier: missingType.generics. Fix code.
1 parent 0f8042d commit c8ceda6

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

phpstan.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414
- '#process\(\) has no return type specified#'
1515
- '#should return Iterator but returns Traversable#'
1616
- '#Negated boolean expression is always false#'
17-
checkGenericClassInNonGenericObjectType: false
17+
- identifier: missingType.generics
1818
reportUnmatchedIgnoredErrors: false
1919
inferPrivatePropertyTypeFromConstructor: true
2020
treatPhpDocTypesAsCertain: false

src/Filesystem/CsvResource.php

-6
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
namespace CleverAge\ProcessBundle\Filesystem;
1515

16-
use function count;
17-
1816
/**
1917
* Read and write CSV resources through a simple API.
2018
*/
@@ -303,10 +301,6 @@ protected function parseHeaders(?array $headers = null): array
303301

304302
$this->manualHeaders = true;
305303

306-
if (!\is_array($headers)) {
307-
throw new \UnexpectedValueException("Invalid headers for {$this->getResourceName()}, you need to pass the headers manually");
308-
}
309-
310304
if ([] === $headers) {
311305
throw new \UnexpectedValueException("Empty headers for {$this->getResourceName()}, you need to pass the headers manually");
312306
}

src/Transformer/CachedTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function (Options $options, $value) {
6565
public function transform(mixed $value, array $options = []): mixed
6666
{
6767
$cacheKey = $this->generateCacheKey($options['cache_key'], $value, $options);
68-
if ($cacheKey && $this->cache instanceof CacheItemPoolInterface) {
68+
if ($cacheKey) {
6969
try {
7070
$cacheItem = $this->cache->getItem($cacheKey);
7171
if ($cacheItem->isHit()) {

0 commit comments

Comments
 (0)