Skip to content

Commit 3e23844

Browse files
authored
Update requirement of psr/log and dev dependencies (#1)
* Added the ability to use the latest versions of psr/log * Add ext-json dependency * Updated PhpUnit configuration * Fixed some tests * Updated vimeo/psalm * Updated squizlabs/php_codesniffer
1 parent 189d439 commit 3e23844

File tree

6 files changed

+37
-41
lines changed

6 files changed

+37
-41
lines changed

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"require": {
2222
"php": "^7.4|^8.0",
23+
"ext-json": "*",
2324
"httpsoft/http-cookie": "^1.0",
2425
"httpsoft/http-emitter": "^1.0",
2526
"httpsoft/http-error-handler": "^1.0",
@@ -33,14 +34,14 @@
3334
"psr/http-message": "^1.0",
3435
"psr/http-server-handler": "^1.0",
3536
"psr/http-server-middleware": "^1.0",
36-
"psr/log": "^1.1"
37+
"psr/log": "^1.1 || ^2.0 || ^3.0"
3738
},
3839
"require-dev": {
3940
"devanych/di-container": "^2.1",
4041
"devanych/view-renderer": "^1.0",
4142
"phpunit/phpunit": "^9.5",
42-
"squizlabs/php_codesniffer": "^3.6",
43-
"vimeo/psalm": "^4.9"
43+
"squizlabs/php_codesniffer": "^3.7",
44+
"vimeo/psalm": "^5.2"
4445
},
4546
"provide": {
4647
"psr/http-message-implementation": "1.0",
File renamed without changes.

phpunit.xml.dist

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
5-
bootstrap="./vendor/autoload.php"
6-
executionOrder="depends,defects"
7-
beStrictAboutCoversAnnotation="true"
8-
beStrictAboutOutputDuringTests="true"
9-
beStrictAboutTodoAnnotatedTests="true"
10-
convertWarningsToExceptions="true"
11-
convertNoticesToExceptions="true"
12-
convertErrorsToExceptions="true"
13-
stopOnFailure="false"
14-
verbose="true"
15-
colors="true"
16-
>
17-
<php>
18-
<ini name="error_reporting" value="-1" />
19-
</php>
20-
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
beStrictAboutCoversAnnotation="true"
7+
beStrictAboutOutputDuringTests="true"
8+
beStrictAboutTodoAnnotatedTests="true"
9+
failOnRisky="true"
10+
failOnWarning="true"
11+
verbose="true"
12+
colors="true">
2113
<testsuites>
2214
<testsuite name="HttpSoft Basis Test Suite">
23-
<directory>./tests/</directory>
15+
<directory>tests</directory>
2416
</testsuite>
2517
</testsuites>
2618

27-
<filter>
28-
<whitelist>
29-
<directory suffix=".php">./src/</directory>
30-
</whitelist>
31-
</filter>
19+
<coverage processUncoveredFiles="true">
20+
<include>
21+
<directory suffix=".php">src</directory>
22+
</include>
23+
</coverage>
3224
</phpunit>
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<?xml version="1.0"?>
22
<psalm
3-
errorLevel="1"
43
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
54
xmlns="https://getpsalm.org/schema/config"
65
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
6+
findUnusedPsalmSuppress="true"
77
>
88
<projectFiles>
9-
<directory name="src" />
9+
<directory name="src"/>
10+
<ignoreFiles>
11+
<directory name="vendor"/>
12+
</ignoreFiles>
1013
</projectFiles>
1114
</psalm>

tests/ErrorHandler/LogErrorListenerTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,41 +41,41 @@ private function createLogger(): LoggerInterface
4141
public string $message = '';
4242
public array $context = [];
4343

44-
public function error($message, array $context = [])
44+
public function error($message, array $context = []): void
4545
{
4646
$this->message = $message;
4747
$this->context = $context;
4848
}
4949

50-
public function emergency($message, array $context = [])
50+
public function emergency($message, array $context = []): void
5151
{
5252
}
5353

54-
public function alert($message, array $context = [])
54+
public function alert($message, array $context = []): void
5555
{
5656
}
5757

58-
public function critical($message, array $context = [])
58+
public function critical($message, array $context = []): void
5959
{
6060
}
6161

62-
public function warning($message, array $context = [])
62+
public function warning($message, array $context = []): void
6363
{
6464
}
6565

66-
public function notice($message, array $context = [])
66+
public function notice($message, array $context = []): void
6767
{
6868
}
6969

70-
public function info($message, array $context = [])
70+
public function info($message, array $context = []): void
7171
{
7272
}
7373

74-
public function debug($message, array $context = [])
74+
public function debug($message, array $context = []): void
7575
{
7676
}
7777

78-
public function log($level, $message, array $context = [])
78+
public function log($level, $message, array $context = []): void
7979
{
8080
}
8181
};

tests/Response/PrepareJsonDataTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testPrepareJsonSerializable(): void
5353
$this->assertSame(
5454
['a' => 1, 'b' => 'string'],
5555
$this->prepareJsonData(new class () implements JsonSerializable {
56-
public function jsonSerialize()
56+
public function jsonSerialize(): array
5757
{
5858
return ['a' => 1, 'b' => 'string'];
5959
}

0 commit comments

Comments
 (0)