Skip to content

Commit 85e83ca

Browse files
committed
Add Psalm
1 parent a431aef commit 85e83ca

File tree

4 files changed

+173
-3
lines changed

4 files changed

+173
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ install:
2121
script:
2222
- vendor/bin/phpcs -n
2323
- composer phpstan
24+
- composer phpstan
2425

2526
jobs:
2627
include:

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,28 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=7.0"
18+
"php": ">=7.1"
1919
},
2020
"require-dev": {
2121
"phpstan/phpstan": "*",
22-
"squizlabs/php_codesniffer": "^3.1"
22+
"squizlabs/php_codesniffer": "^3.1",
23+
"vimeo/psalm": "^4.0"
2324
},
2425
"autoload": {
2526
"psr-4": {
2627
"LanguageServerProtocol\\": "src/"
2728
}
2829
},
30+
"extra": {
31+
"branch-alias": {
32+
"dev-master": "1.x-dev"
33+
}
34+
},
2935
"minimum-stability": "dev",
3036
"prefer-stable": true,
3137
"scripts":
3238
{
33-
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon --ansi --level=7 -vvv src"
39+
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon --ansi --level=7 -vvv src",
40+
"psalm": "./vendor/bin/psalm"
3441
}
3542
}

psalm-baseline.xml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="4.0.1@b1e2e30026936ef8d5bf6a354d1c3959b6231f44">
3+
<file src="src/CodeLens.php">
4+
<PossiblyNullPropertyAssignmentValue occurrences="1">
5+
<code>$range</code>
6+
</PossiblyNullPropertyAssignmentValue>
7+
</file>
8+
<file src="src/CompletionContext.php">
9+
<PossiblyNullPropertyAssignmentValue occurrences="1">
10+
<code>$triggerKind</code>
11+
</PossiblyNullPropertyAssignmentValue>
12+
</file>
13+
<file src="src/CompletionItem.php">
14+
<PossiblyNullPropertyAssignmentValue occurrences="1">
15+
<code>$label</code>
16+
</PossiblyNullPropertyAssignmentValue>
17+
</file>
18+
<file src="src/ContentChangeEvent.php">
19+
<PossiblyNullPropertyAssignmentValue occurrences="1">
20+
<code>$text</code>
21+
</PossiblyNullPropertyAssignmentValue>
22+
</file>
23+
<file src="src/Diagnostic.php">
24+
<PossiblyNullPropertyAssignmentValue occurrences="1">
25+
<code>$message</code>
26+
</PossiblyNullPropertyAssignmentValue>
27+
</file>
28+
<file src="src/DocumentHighlight.php">
29+
<PossiblyNullPropertyAssignmentValue occurrences="1">
30+
<code>$range</code>
31+
</PossiblyNullPropertyAssignmentValue>
32+
</file>
33+
<file src="src/DocumentOnTypeFormattingOptions.php">
34+
<PossiblyNullPropertyAssignmentValue occurrences="1">
35+
<code>$firstTriggerCharacter</code>
36+
</PossiblyNullPropertyAssignmentValue>
37+
</file>
38+
<file src="src/FormattingOptions.php">
39+
<PossiblyNullPropertyAssignmentValue occurrences="2">
40+
<code>$insertSpaces</code>
41+
<code>$tabSize</code>
42+
</PossiblyNullPropertyAssignmentValue>
43+
</file>
44+
<file src="src/Hover.php">
45+
<PossiblyNullPropertyAssignmentValue occurrences="1">
46+
<code>$contents</code>
47+
</PossiblyNullPropertyAssignmentValue>
48+
</file>
49+
<file src="src/Location.php">
50+
<PossiblyNullPropertyAssignmentValue occurrences="2">
51+
<code>$range</code>
52+
<code>$uri</code>
53+
</PossiblyNullPropertyAssignmentValue>
54+
</file>
55+
<file src="src/MarkedString.php">
56+
<PossiblyNullPropertyAssignmentValue occurrences="2">
57+
<code>$language</code>
58+
<code>$value</code>
59+
</PossiblyNullPropertyAssignmentValue>
60+
</file>
61+
<file src="src/MarkupContent.php">
62+
<PossiblyNullPropertyAssignmentValue occurrences="2">
63+
<code>$kind</code>
64+
<code>$value</code>
65+
</PossiblyNullPropertyAssignmentValue>
66+
</file>
67+
<file src="src/MessageActionItem.php">
68+
<PossiblyNullPropertyAssignmentValue occurrences="1">
69+
<code>$title</code>
70+
</PossiblyNullPropertyAssignmentValue>
71+
</file>
72+
<file src="src/PackageDescriptor.php">
73+
<PossiblyNullPropertyAssignmentValue occurrences="1">
74+
<code>$name</code>
75+
</PossiblyNullPropertyAssignmentValue>
76+
</file>
77+
<file src="src/Position.php">
78+
<PossiblyNullPropertyAssignmentValue occurrences="2">
79+
<code>$character</code>
80+
<code>$line</code>
81+
</PossiblyNullPropertyAssignmentValue>
82+
</file>
83+
<file src="src/Range.php">
84+
<PossiblyNullPropertyAssignmentValue occurrences="2">
85+
<code>$end</code>
86+
<code>$start</code>
87+
</PossiblyNullPropertyAssignmentValue>
88+
</file>
89+
<file src="src/ReferenceContext.php">
90+
<PossiblyNullPropertyAssignmentValue occurrences="1">
91+
<code>$includeDeclaration</code>
92+
</PossiblyNullPropertyAssignmentValue>
93+
</file>
94+
<file src="src/ReferenceInformation.php">
95+
<PossiblyNullPropertyAssignmentValue occurrences="2">
96+
<code>$reference</code>
97+
<code>$symbol</code>
98+
</PossiblyNullPropertyAssignmentValue>
99+
</file>
100+
<file src="src/SymbolDescriptor.php">
101+
<PossiblyNullPropertyAssignmentValue occurrences="1">
102+
<code>$fqsen</code>
103+
</PossiblyNullPropertyAssignmentValue>
104+
</file>
105+
<file src="src/SymbolInformation.php">
106+
<PossiblyNullPropertyAssignmentValue occurrences="3">
107+
<code>$kind</code>
108+
<code>$location</code>
109+
<code>$name</code>
110+
</PossiblyNullPropertyAssignmentValue>
111+
</file>
112+
<file src="src/SymbolLocationInformation.php">
113+
<PossiblyNullPropertyAssignmentValue occurrences="1">
114+
<code>$symbol</code>
115+
</PossiblyNullPropertyAssignmentValue>
116+
</file>
117+
<file src="src/TextDocumentContentChangeEvent.php">
118+
<PossiblyNullPropertyAssignmentValue occurrences="1">
119+
<code>$text</code>
120+
</PossiblyNullPropertyAssignmentValue>
121+
</file>
122+
<file src="src/TextDocumentIdentifier.php">
123+
<PossiblyNullPropertyAssignmentValue occurrences="1">
124+
<code>$uri</code>
125+
</PossiblyNullPropertyAssignmentValue>
126+
</file>
127+
<file src="src/TextDocumentItem.php">
128+
<PossiblyNullPropertyAssignmentValue occurrences="4">
129+
<code>$languageId</code>
130+
<code>$text</code>
131+
<code>$uri</code>
132+
<code>$version</code>
133+
</PossiblyNullPropertyAssignmentValue>
134+
</file>
135+
<file src="src/TextEdit.php">
136+
<PossiblyNullPropertyAssignmentValue occurrences="2">
137+
<code>$newText</code>
138+
<code>$range</code>
139+
</PossiblyNullPropertyAssignmentValue>
140+
</file>
141+
<file src="src/VersionedTextDocumentIdentifier.php">
142+
<PossiblyNullPropertyAssignmentValue occurrences="1">
143+
<code>$version</code>
144+
</PossiblyNullPropertyAssignmentValue>
145+
</file>
146+
</files>

psalm.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
errorBaseline="psalm-baseline.xml"
9+
>
10+
<projectFiles>
11+
<directory name="src" />
12+
<ignoreFiles>
13+
<directory name="vendor" />
14+
</ignoreFiles>
15+
</projectFiles>
16+
</psalm>

0 commit comments

Comments
 (0)