Skip to content

Commit 8e8367c

Browse files
committed
phpstan level 9
1 parent 2013e47 commit 8e8367c

5 files changed

Lines changed: 13 additions & 7 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
7474
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-directory=build/phpunit",
7575
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",
76-
"test:static-analysis": "mkdir -p build && bash -c 'vendor/bin/phpstan analyse src --no-progress --level=8 --error-format=junit | tee build/phpstan.junit.xml; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
76+
"test:static-analysis": "mkdir -p build && bash -c 'vendor/bin/phpstan analyse src --no-progress --level=9 --error-format=junit | tee build/phpstan.junit.xml; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
7777
"test:unit": "vendor/bin/phpunit --testsuite=Unit --coverage-text --coverage-clover=build/phpunit/clover.xml --coverage-html=build/phpunit/coverage-html --coverage-xml=build/phpunit/coverage-xml --log-junit=build/phpunit/junit.xml --cache-directory=build/phpunit"
7878
}
7979
}

src/Decoder/JsonTypeDecoder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public function decode(string $data): array
3030
throw RuntimeException::createNotParsable($this->getContentType(), 'Not an object');
3131
}
3232

33+
/** @var array<string, null|array|bool|float|int|string> $decoded */
34+
3335
return $decoded;
3436
}
3537
}

src/Decoder/YamlTypeDecoder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public function decode(string $data): array
3232
throw RuntimeException::createNotParsable($this->getContentType(), 'Not an object');
3333
}
3434

35+
/** @var array<string, null|array|bool|float|int|string> $decoded */
36+
3537
return $decoded;
3638
}
3739
}

src/ServiceFactory/DecoderFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ final class DecoderFactory extends AbstractFactory
1414
{
1515
public function __invoke(ContainerInterface $container): DecoderInterface
1616
{
17-
return new Decoder(
18-
$container->get(TypeDecoderInterface::class.'[]'.$this->name)
19-
);
17+
/** @var array<int, TypeDecoderInterface> $decoderTypes */
18+
$decoderTypes = $container->get(TypeDecoderInterface::class.'[]'.$this->name);
19+
20+
return new Decoder($decoderTypes);
2021
}
2122
}

src/ServiceFactory/EncoderFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ final class EncoderFactory extends AbstractFactory
1414
{
1515
public function __invoke(ContainerInterface $container): EncoderInterface
1616
{
17-
return new Encoder(
18-
$container->get(TypeEncoderInterface::class.'[]'.$this->name)
19-
);
17+
/** @var array<int, TypeEncoderInterface> $encoderTypes */
18+
$encoderTypes = $container->get(TypeEncoderInterface::class.'[]'.$this->name);
19+
20+
return new Encoder($encoderTypes);
2021
}
2122
}

0 commit comments

Comments
 (0)