diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
new file mode 100644
index 0000000..03d62cb
--- /dev/null
+++ b/.github/workflows/static-analysis.yml
@@ -0,0 +1,50 @@
+on:
+ - push
+
+name: Run PHPStan checks
+
+jobs:
+ mutation:
+ name: PHPStan ${{ matrix.php }}-${{ matrix.os }}
+
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os:
+ - ubuntu-latest
+
+ php:
+ - "8.1"
+ - "8.2"
+ - "8.3"
+ - "8.4"
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: "${{ matrix.php }}"
+ coverage: pcov
+ ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
+ tools: composer:v2, cs2pr
+
+ - name: Determine composer cache directory
+ run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
+
+ - name: Cache dependencies installed with composer
+ uses: actions/cache@v4
+ with:
+ path: ${{ env.COMPOSER_CACHE_DIR }}
+ key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
+ restore-keys: |
+ php${{ matrix.php }}-composer-
+
+ - name: Install dependencies with composer
+ run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
+
+ - name: Run static analysis with PHPStan
+ run: vendor/bin/phpstan analyse
diff --git a/README.md b/README.md
index 3564f00..04a3190 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,17 @@
# dot-authentication
-Authentication base package defining interfaces for authentication services to be used with Dotkernel applications.
+Core interfaces for authentication implementations.
+
+`dot-authentication` is Dotkernel's authentication base package which define interfaces for authentication services to be used with Dotkernel applications.
+
+## Documentation
+
+Documentation is available at: https://docs.dotkernel.org/dot-authentication/.
+
+## Badges

-
+
[](https://github.com/dotkernel/dot-authentication/issues)
[](https://github.com/dotkernel/dot-authentication/network)
@@ -12,6 +20,7 @@ Authentication base package defining interfaces for authentication services to b
[](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml)
[](https://codecov.io/gh/dotkernel/dot-authentication)
+[](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml)
## Installation
diff --git a/composer.json b/composer.json
index c1a0777..7114fff 100644
--- a/composer.json
+++ b/composer.json
@@ -15,8 +15,9 @@
},
"require-dev": {
"laminas/laminas-coding-standard": "^3.0",
- "phpunit/phpunit": "^10.2",
- "vimeo/psalm": "^6.0"
+ "phpstan/phpstan": "^2.1",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpunit/phpunit": "^10.2"
},
"autoload": {
"psr-4": {
@@ -44,7 +45,6 @@
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit --colors=always",
- "test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
- "static-analysis": "psalm --shepherd --stats"
+ "static-analysis": "phpstan analyse --memory-limit 1G"
}
}
diff --git a/docs/book/v2/overview.md b/docs/book/v2/overview.md
index 152b2e8..75192ef 100644
--- a/docs/book/v2/overview.md
+++ b/docs/book/v2/overview.md
@@ -1,3 +1,19 @@
# Overview
+Core interfaces for authentication implementations.
+
`dot-authentication` is Dotkernel's authentication base package which define interfaces for authentication services to be used with Dotkernel applications.
+
+## Badges
+
+
+
+
+[](https://github.com/dotkernel/dot-authentication/issues)
+[](https://github.com/dotkernel/dot-authentication/network)
+[](https://github.com/dotkernel/dot-authentication/stargazers)
+[](https://github.com/dotkernel/dot-authentication/blob/2.0/LICENSE.md)
+
+[](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml)
+[](https://codecov.io/gh/dotkernel/dot-authentication)
+[](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml)
diff --git a/phpstan.neon b/phpstan.neon
new file mode 100644
index 0000000..349be25
--- /dev/null
+++ b/phpstan.neon
@@ -0,0 +1,8 @@
+includes:
+ - vendor/phpstan/phpstan-phpunit/extension.neon
+parameters:
+ level: 5
+ paths:
+ - src
+ - test
+ treatPhpDocTypesAsCertain: false
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
deleted file mode 100644
index 446f66a..0000000
--- a/psalm-baseline.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/psalm.xml b/psalm.xml
deleted file mode 100644
index 55c65c5..0000000
--- a/psalm.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/test/Exception/InvalidArgumentExceptionTest.php b/test/Exception/InvalidArgumentExceptionTest.php
index c113633..3976d47 100644
--- a/test/Exception/InvalidArgumentExceptionTest.php
+++ b/test/Exception/InvalidArgumentExceptionTest.php
@@ -5,7 +5,6 @@
namespace DotTest\Authentication\Exception;
use InvalidArgumentException;
-use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
@@ -13,9 +12,6 @@ class InvalidArgumentExceptionTest extends TestCase
{
protected InvalidArgumentException|MockObject $exceptionInterfaceMock;
- /**
- * @throws Exception
- */
public function setUp(): void
{
$this->exceptionInterfaceMock = $this->createMock(InvalidArgumentException::class);
diff --git a/test/Exception/RuntimeExceptionTest.php b/test/Exception/RuntimeExceptionTest.php
index d6cc50f..c600598 100644
--- a/test/Exception/RuntimeExceptionTest.php
+++ b/test/Exception/RuntimeExceptionTest.php
@@ -5,7 +5,6 @@
namespace DotTest\Authentication\Exception;
use Dot\Authentication\Exception\RuntimeException;
-use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
@@ -13,9 +12,6 @@ class RuntimeExceptionTest extends TestCase
{
protected RuntimeException|MockObject $exceptionInterfaceMock;
- /**
- * @throws Exception
- */
public function setUp(): void
{
$this->exceptionInterfaceMock = $this->createMock(RuntimeException::class);
diff --git a/test/Exception/UnauthorizedExceptionTest.php b/test/Exception/UnauthorizedExceptionTest.php
index 005ef60..62fdfb6 100644
--- a/test/Exception/UnauthorizedExceptionTest.php
+++ b/test/Exception/UnauthorizedExceptionTest.php
@@ -5,7 +5,6 @@
namespace DotTest\Authentication\Exception;
use Dot\Authentication\Exception\UnauthorizedException;
-use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
@@ -13,9 +12,6 @@ class UnauthorizedExceptionTest extends TestCase
{
protected UnauthorizedException|MockObject $exceptionInterfaceMock;
- /**
- * @throws Exception
- */
public function setUp(): void
{
$this->exceptionInterfaceMock = $this->createMock(UnauthorizedException::class);