Skip to content

Commit 14fc5e8

Browse files
Identify and fix deprecations
1 parent 2a50071 commit 14fc5e8

14 files changed

+265
-226
lines changed

Diff for: composer.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
},
4444
"require-dev": {
4545
"navikt/coding-standard": "^2.0",
46+
"phpstan/extension-installer": "^1.4",
4647
"phpstan/phpstan": "^2.1",
48+
"phpstan/phpstan-deprecation-rules": "^2.0",
49+
"phpstan/phpstan-doctrine": "^2.0",
50+
"phpstan/phpstan-phpunit": "^2.0",
4751
"phpunit/phpunit": "^11.5",
4852
"symfony/var-dumper": "^7.2"
4953
},
@@ -63,6 +67,9 @@
6367
]
6468
},
6569
"config": {
66-
"sort-packages": true
70+
"sort-packages": true,
71+
"allow-plugins": {
72+
"phpstan/extension-installer": true
73+
}
6774
}
6875
}

Diff for: composer.lock

+218-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: phpunit.dist.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" bootstrap="vendor/autoload.php" beStrictAboutOutputDuringTests="true" requireCoverageMetadata="true" beStrictAboutCoverageMetadata="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" bootstrap="vendor/autoload.php" beStrictAboutOutputDuringTests="true" requireCoverageMetadata="true" displayDetailsOnPhpunitDeprecations="true">
33
<testsuites>
44
<testsuite name="default">
55
<directory suffix="Test.php">tests</directory>

Diff for: tests/Controllers/ApiControllerTest.php

+2-19
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@
33
namespace Naisdevice\Jita\Controllers;
44

55
use Doctrine\DBAL\Connection;
6+
use PHPUnit\Framework\Attributes\CoversClass;
67
use PHPUnit\Framework\TestCase;
78
use Psr\Http\Message\ResponseInterface as Response;
89
use Psr\Http\Message\ServerRequestInterface as Request;
910
use Psr\Http\Message\StreamInterface;
1011

11-
/**
12-
* @coversDefaultClass Naisdevice\Jita\Controllers\ApiController
13-
*/
12+
#[CoversClass(ApiController::class)]
1413
class ApiControllerTest extends TestCase
1514
{
16-
/**
17-
* @covers ::__construct
18-
* @covers ::requests
19-
*/
2015
public function testWillRenderRequests(): void
2116
{
2217
$connection = $this->createConfiguredMock(Connection::class, [
@@ -65,10 +60,6 @@ public function testWillRenderRequests(): void
6560
$this->assertSame($modifiedResponse, $controller->requests($request, $response));
6661
}
6762

68-
/**
69-
* @covers ::gatewayAccess
70-
* @covers ::getAccessRowsWithTtl
71-
*/
7263
public function testCanGetGatewayAccess(): void
7364
{
7465
$connection = $this->createConfiguredMock(Connection::class, [
@@ -130,10 +121,6 @@ public function testCanGetGatewayAccess(): void
130121
);
131122
}
132123

133-
/**
134-
* @covers ::gatewaysAccess
135-
* @covers ::getAccessRowsWithTtl
136-
*/
137124
public function testCanGetGatewaysAccess(): void
138125
{
139126
$connection = $this->createConfiguredMock(Connection::class, [
@@ -197,10 +184,6 @@ public function testCanGetGatewaysAccess(): void
197184
);
198185
}
199186

200-
/**
201-
* @covers ::userAccess
202-
* @covers ::getAccessRowsWithTtl
203-
*/
204187
public function testCanGetUserAccess(): void
205188
{
206189
$connection = $this->createConfiguredMock(Connection::class, [

0 commit comments

Comments
 (0)