Skip to content

Commit 1097f99

Browse files
committed
Update linting config
1 parent fb1275c commit 1097f99

File tree

3 files changed

+62
-16
lines changed

3 files changed

+62
-16
lines changed

phpcs.xml.dist

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,26 @@
3030

3131
<!--
3232
#############################################################################
33-
USE THE PHPCSDev, VariableAnalysis RULESETS
33+
USE THE PSR12, VariableAnalysis RULESETS
3434
#############################################################################
3535
-->
3636

3737
<!-- Set minimum PHP version supported to PHP 5.4. -->
3838
<config name="testVersion" value="5.4-"/>
3939

40-
<rule ref="PHPCSDev">
40+
<rule ref="PSR12">
4141
<!-- This code base uses tab indentation instead of spaces. -->
4242
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
4343

44-
<!-- Don't enforce lining up the assignment operators in assignment blocks. -->
45-
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
46-
47-
<!-- Don't enforce lining up the double arrows in array declarations.
48-
Possibly enforce this later once the sniff has been replaced by a better, more configurable version. -->
49-
<exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/>
50-
51-
<!-- Don't enforce documentation (yet). -->
52-
<exclude name="Generic.Commenting.DocComment"/>
53-
<exclude name="PEAR.Commenting.ClassComment"/>
54-
<exclude name="PEAR.Commenting.FileComment"/>
55-
<exclude name="PEAR.Commenting.InlineComment"/>
56-
5744
<!-- WIP: This is part of PSR12 and should probably be enforced,
5845
but the codebase needs work before it can be enabled. -->
59-
<exclude name="Generic.Files.LineLength.TooLong" />
46+
<exclude name="Generic.Files.LineLength"/>
47+
48+
<!-- Disable excessive function spacing requirements -->
49+
<exclude name="Squiz.WhiteSpace.FunctionSpacing"/>
50+
51+
<!-- Project supports PHP 5.4+ which doesn't have constant visibility -->
52+
<exclude name="PSR12.Properties.ConstantVisibility"/>
6053
</rule>
6154

6255
<rule ref="VariableAnalysis"/>

psalm-baseline.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="6.13.1@1e3b7f0a8ab32b23197b91107adc0a7ed8a05b51">
3+
<file src="VariableAnalysis/Lib/EnumInfo.php">
4+
<PossiblyUnusedProperty>
5+
<code><![CDATA[$enumIndex]]></code>
6+
</PossiblyUnusedProperty>
7+
</file>
8+
<file src="VariableAnalysis/Lib/ForLoopInfo.php">
9+
<PossiblyUnusedProperty>
10+
<code><![CDATA[$conditionEnd]]></code>
11+
<code><![CDATA[$conditionStart]]></code>
12+
<code><![CDATA[$forIndex]]></code>
13+
<code><![CDATA[$initEnd]]></code>
14+
<code><![CDATA[$initStart]]></code>
15+
</PossiblyUnusedProperty>
16+
</file>
17+
<file src="VariableAnalysis/Lib/Helpers.php">
18+
<InvalidArgument>
19+
<code><![CDATA[$closePtr]]></code>
20+
</InvalidArgument>
21+
<InvalidOperand>
22+
<code><![CDATA[$closePtr]]></code>
23+
</InvalidOperand>
24+
<PossiblyFalseArgument>
25+
<code><![CDATA[$varName]]></code>
26+
<code><![CDATA[$varName]]></code>
27+
</PossiblyFalseArgument>
28+
<PossiblyInvalidOperand>
29+
<code><![CDATA[$message]]></code>
30+
</PossiblyInvalidOperand>
31+
<PossiblyUnusedMethod>
32+
<code><![CDATA[isTokenInsideArrowFunctionDefinition]]></code>
33+
</PossiblyUnusedMethod>
34+
<UnusedVariable>
35+
<code><![CDATA[$isNestedAssignment]]></code>
36+
</UnusedVariable>
37+
</file>
38+
<file src="VariableAnalysis/Lib/VariableInfo.php">
39+
<PossiblyUnusedProperty>
40+
<code><![CDATA[$typeHint]]></code>
41+
</PossiblyUnusedProperty>
42+
</file>
43+
<file src="VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php">
44+
<MissingOverrideAttribute>
45+
<code><![CDATA[public function process(File $phpcsFile, $stackPtr)]]></code>
46+
<code><![CDATA[public function register()]]></code>
47+
</MissingOverrideAttribute>
48+
<UnusedClass>
49+
<code><![CDATA[VariableAnalysisSniff]]></code>
50+
</UnusedClass>
51+
</file>
52+
</files>

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
77
xmlns="https://getpsalm.org/schema/config"
88
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
9+
errorBaseline="psalm-baseline.xml"
910
>
1011
<projectFiles>
1112
<directory name="VariableAnalysis" />

0 commit comments

Comments
 (0)