Skip to content

Commit b3f9ca8

Browse files
authored
Merge pull request #29 from andrew-demb/psalm
Introduce SA checks with vime/psalm
2 parents d6bfbb1 + cd40837 commit b3f9ca8

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"symfony/yaml": "^4.4|^5.4|^6.0",
1818
"symfony/service-contracts": "^2|^3"
1919
},
20+
"require-dev": {
21+
"vimeo/psalm": "^5.15"
22+
},
2023
"minimum-stability": "dev",
2124
"prefer-stable": true
2225
}

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>

src/Context/Extractor/EnvContextExtractor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212

1313
class EnvContextExtractor implements ContextExtractorInterface, EventSubscriberInterface
1414
{
15-
/**
16-
* @var CodecInterface[]
17-
*/
1815
private $registry;
1916

2017
private $format;

src/Context/Extractor/HeaderContextExtractor.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace Jaeger\Symfony\Context\Extractor;
55

6-
use Jaeger\Codec\CodecInterface;
76
use Jaeger\Codec\CodecRegistry;
87
use Jaeger\Span\Context\SpanContext;
98
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -14,9 +13,6 @@
1413

1514
class HeaderContextExtractor implements ContextExtractorInterface, EventSubscriberInterface, ResetInterface
1615
{
17-
/**
18-
* @var CodecInterface[]
19-
*/
2016
private $registry;
2117

2218
private $format;

0 commit comments

Comments
 (0)