Skip to content

Commit

Permalink
phpstan level 9 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Feb 19, 2022
1 parent ed3e621 commit bb56f94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"scripts": {
"test": "phpunit",
"analyse": "phpstan analyse src tests --level=8",
"analyse": "phpstan analyse src tests --level=9",
"check-style": "phpcs -p --standard=PSR12 --exclude=Generic.Files.LineLength --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
"fix-style": "phpcbf -p --standard=PSR12 --exclude=Generic.Files.LineLength --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests"
},
Expand Down
10 changes: 8 additions & 2 deletions tests/CorsServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Fruitcake\Cors\Exceptions\InvalidOptionException;
use PHPUnit\Framework\TestCase;

/**
* @phpstan-import-type CorsNormalizedOptions from CorsService
*/
class CorsServiceTest extends TestCase
{
/**
Expand Down Expand Up @@ -113,7 +116,7 @@ public function itNormalizesUnderscoreOptions(): void

/**
* @param CorsService $service
* @return array<mixed>
* @return CorsNormalizedOptions
*/
private function getOptionsFromService(CorsService $service): array
{
Expand All @@ -122,6 +125,9 @@ private function getOptionsFromService(CorsService $service): array
$property = $reflected->getProperty('options');
$property->setAccessible(true);

return $property->getValue($service);
/** @var CorsNormalizedOptions $options */
$options = $property->getValue($service);

return $options;
}
}

0 comments on commit bb56f94

Please sign in to comment.