Skip to content

Commit 00d9cac

Browse files
committed
add psalm
1 parent 42b66d6 commit 00d9cac

4 files changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ jobs:
2626
- name: phpstan
2727
run: vendor/bin/phpstan analyse -c phpstan.neon
2828

29+
- name: psalm
30+
run: vendor/bin/psalm
31+
2932
- name: Run Tests
3033
run: vendor/bin/phpunit --testdox

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"require-dev": {
2626
"phpunit/phpunit": "^9.0",
2727
"php-http/psr7-integration-tests": "^1.2",
28-
"phpstan/phpstan": "^1.9"
28+
"phpstan/phpstan": "^1.9",
29+
"vimeo/psalm": "^5.4"
2930
}
3031
}

psalm.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="1"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
<issueHandlers>
16+
<DocblockTypeContradiction errorLevel="info"/>
17+
</issueHandlers>
18+
</psalm>

src/Uri.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function __construct (string|Stringable|null $uri) {
4141

4242
$this->originalUri = $uri;
4343
foreach ($uriComponents as $component => $value) {
44+
/** @psalm-suppress InvalidScalarArgument TODO: Remove when psalm supports `ArrayShape` attribute */
4445
match ($component) {
4546
Component::HOST => $this->host = UriParser::parseHost($value),
4647
Component::PATH => $this->path = UriParser::parsePath($value),

0 commit comments

Comments
 (0)