Skip to content

Commit 855dd86

Browse files
committed
Add vimeo/psalm
1 parent 601e640 commit 855dd86

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/.scrutinizer.yml export-ignore
88
/phpcs.xml export-ignore
99
/phpunit.xml.dist export-ignore
10+
/psalm.xml export-ignore

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
},
2727
"require-dev": {
2828
"phpunit/phpunit": "^9.1",
29-
"squizlabs/php_codesniffer": "^3.5"
29+
"squizlabs/php_codesniffer": "^3.5",
30+
"vimeo/psalm": "^3.12"
3031
},
3132
"autoload": {
3233
"psr-4": {
@@ -40,10 +41,12 @@
4041
},
4142
"scripts": {
4243
"test": "phpunit --colors=always",
44+
"static": "psalm",
4345
"cs-check": "phpcs",
4446
"cs-fix": "phpcbf",
4547
"check": [
4648
"@cs-check",
49+
"@static",
4750
"@test"
4851
]
4952
}

psalm.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
totallyTyped="true"
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+
16+
<issueHandlers>
17+
<DocblockTypeContradiction errorLevel="info" />
18+
<LessSpecificImplementedReturnType errorLevel="info" />
19+
<MixedArgumentTypeCoercion errorLevel="info" />
20+
<MixedAssignment errorLevel="info" />
21+
<MixedPropertyTypeCoercion errorLevel="info" />
22+
<PropertyNotSetInConstructor errorLevel="info" />
23+
<RedundantConditionGivenDocblockType errorLevel="info" />
24+
</issueHandlers>
25+
</psalm>

src/RequestTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private function init(
245245
/**
246246
* Set and validate the HTTP method
247247
*
248-
* @param mixed $method
248+
* @param string $method
249249
* @throws InvalidArgumentException for invalid HTTP method.
250250
*/
251251
private function setMethod(string $method): void

0 commit comments

Comments
 (0)