Skip to content

Commit f435637

Browse files
committed
Add plugin for psalm to detect insane comparisons
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent ee49498 commit f435637

File tree

3 files changed

+67
-122
lines changed

3 files changed

+67
-122
lines changed

psalm.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
errorBaseline="build/psalm-baseline.xml"
99
>
1010
<plugins>
11-
<plugin filename="build/psalm/AppFrameworkTainter.php" />
11+
<plugin filename="build/psalm/AppFrameworkTainter.php"/>
12+
<pluginClass class="Orklah\PsalmInsaneComparison\Plugin"/>
1213
</plugins>
1314
<projectFiles>
1415
<directory name="apps/accessibility"/>
@@ -115,14 +116,14 @@
115116
<referencedVariable name="$l"/>
116117
<referencedVariable name="$theme"/>
117118
<!-- false positive: https://github.com/nextcloud/server/blob/cb057829f72c70e819f456edfadbb29d72dba832/lib/private/Console/Application.php#L92 -->
118-
<file name="core/register_command.php" />
119+
<file name="core/register_command.php"/>
119120
</errorLevel>
120121
</UndefinedGlobalVariable>
121122
<UndefinedDocblockClass>
122123
<errorLevel type="suppress">
123124
<!-- Helper classes for sharing API integration from other apps -->
124-
<referencedClass name="OCA\Deck\Sharing\ShareAPIHelper" />
125-
<referencedClass name="OCA\Talk\Share\Helper\DeletedShareAPIController" />
125+
<referencedClass name="OCA\Deck\Sharing\ShareAPIHelper"/>
126+
<referencedClass name="OCA\Talk\Share\Helper\DeletedShareAPIController"/>
126127
</errorLevel>
127128
</UndefinedDocblockClass>
128129
</issueHandlers>

vendor-bin/psalm/composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
"php": "7.3"
55
}
66
},
7-
"require": {
8-
"vimeo/psalm": "4.8.1"
9-
}
7+
"require": {
8+
"vimeo/psalm": "4.8.1"
9+
},
10+
"require-dev": {
11+
"orklah/psalm-insane-comparison": "^1.0"
12+
}
1013
}

0 commit comments

Comments
 (0)