Skip to content

Commit

Permalink
Test with PHP 8.2 and 8.3, update phpstan/phpstan (#89)
Browse files Browse the repository at this point in the history
* Update PHPstan configuration
* Fix failing tests
* Add new PHP versions to tests
  • Loading branch information
jankonas authored Jun 24, 2024
1 parent e3e7038 commit f8bd0ef
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ insert_final_newline = true
[*.php]
indent_size = 4

[*.neon]
indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.2", "7.3", "7.4", "8.0", "8.1"]
php-versions: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
dependency-versions: ["highest", "lowest"]
runs-on: ${{ matrix.operating-system }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"equip/dispatch": "^2.0",
"nyholm/psr7": "^1.5",
"overtrue/phplint": "^3.0",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-strict-rules": "^1.4",
"phpunit/phpunit": "^8.5.30|^9.0",
"rector/rector": "^0.14.0",
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
ignoreErrors:
- identifier: missingType.iterableValue
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
9 changes: 9 additions & 0 deletions src/CorsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ private function fixHeaders(array $headers): array

/**
* Set allowed origin.
* @phpstan-ignore method.unused
*/
private function origin(array $origin): void
{
Expand All @@ -300,6 +301,7 @@ private function origin(array $origin): void
/**
* Set request methods to be allowed.
* @param callable|array $methods.
* @phpstan-ignore method.unused
*/
private function methods($methods): void
{
Expand All @@ -316,6 +318,7 @@ private function methods($methods): void

/**
* Set headers to be allowed.
* @phpstan-ignore method.unused
*/
private function headersAllow(array $headers): void
{
Expand All @@ -324,6 +327,7 @@ private function headersAllow(array $headers): void

/**
* Set headers to be exposed.
* @phpstan-ignore method.unused
*/
private function headersExpose(array $headers): void
{
Expand All @@ -332,6 +336,7 @@ private function headersExpose(array $headers): void

/**
* Enable or disable cookies and authentication.
* @phpstan-ignore method.unused
*/
private function credentials(bool $credentials): void
{
Expand All @@ -340,6 +345,7 @@ private function credentials(bool $credentials): void

/**
* Set the server origin.
* @phpstan-ignore method.unused
*/
private function originServer(?string $origin): void
{
Expand All @@ -348,6 +354,7 @@ private function originServer(?string $origin): void

/**
* Set the cache time in seconds.
* @phpstan-ignore method.unused
*/
private function cache(int $cache): void
{
Expand All @@ -356,6 +363,7 @@ private function cache(int $cache): void

/**
* Set the error handler.
* @phpstan-ignore method.unused
*/
private function error(callable $error): void
{
Expand All @@ -368,6 +376,7 @@ private function error(callable $error): void

/**
* Set the PSR-3 logger.
* @phpstan-ignore method.unused
*/
private function logger(LoggerInterface $logger = null): void
{
Expand Down

0 comments on commit f8bd0ef

Please sign in to comment.