Skip to content

Commit cd40837

Browse files
committed
✨ Introduce SA with psalm
1 parent c69efa7 commit cd40837

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"symfony/http-kernel": "^4.4|^5.4|^6.0",
1717
"symfony/yaml": "^4.4|^5.4|^6.0"
1818
},
19+
"require-dev": {
20+
"vimeo/psalm": "^5.15"
21+
},
1922
"minimum-stability": "dev",
2023
"prefer-stable": true
2124
}

psalm.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
phpVersion="8.1" used to avoid `ReservedWord` issues with installed Symfony 6+ packages (which required 8.1).
4+
Probably there existent another easy workaround, but we didn't find it yet.
5+
-->
6+
<!--suppress XmlDefaultAttributeValue Psalm emits warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting. -->
7+
<psalm
8+
errorLevel="6"
9+
phpVersion="8.1"
10+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xmlns="https://getpsalm.org/schema/config"
12+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
13+
findUnusedBaselineEntry="true"
14+
findUnusedCode="false"
15+
>
16+
<projectFiles>
17+
<directory name="src" />
18+
<ignoreFiles>
19+
<directory name="vendor" />
20+
</ignoreFiles>
21+
</projectFiles>
22+
23+
<issueHandlers>
24+
<UndefinedMethod>
25+
<errorLevel type="suppress">
26+
<!-- BC layer for Symfony 4.4 -->
27+
<referencedMethod name="Symfony\Component\HttpKernel\Event\KernelEvent::isMasterRequest" />
28+
29+
<!-- Psalm doesn't know about type-system of `symfony/config` -->
30+
<file name="src/DependencyInjection/Configuration.php"/>
31+
</errorLevel>
32+
</UndefinedMethod>
33+
</issueHandlers>
34+
</psalm>

0 commit comments

Comments
 (0)