Skip to content

Commit bb56f94

Browse files
authored
phpstan level 9 (#4)
1 parent ed3e621 commit bb56f94

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"scripts": {
3434
"test": "phpunit",
35-
"analyse": "phpstan analyse src tests --level=8",
35+
"analyse": "phpstan analyse src tests --level=9",
3636
"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",
3737
"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"
3838
},

tests/CorsServiceTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use Fruitcake\Cors\Exceptions\InvalidOptionException;
1717
use PHPUnit\Framework\TestCase;
1818

19+
/**
20+
* @phpstan-import-type CorsNormalizedOptions from CorsService
21+
*/
1922
class CorsServiceTest extends TestCase
2023
{
2124
/**
@@ -113,7 +116,7 @@ public function itNormalizesUnderscoreOptions(): void
113116

114117
/**
115118
* @param CorsService $service
116-
* @return array<mixed>
119+
* @return CorsNormalizedOptions
117120
*/
118121
private function getOptionsFromService(CorsService $service): array
119122
{
@@ -122,6 +125,9 @@ private function getOptionsFromService(CorsService $service): array
122125
$property = $reflected->getProperty('options');
123126
$property->setAccessible(true);
124127

125-
return $property->getValue($service);
128+
/** @var CorsNormalizedOptions $options */
129+
$options = $property->getValue($service);
130+
131+
return $options;
126132
}
127133
}

0 commit comments

Comments
 (0)