Browse Source

Set baseline file for psalm.

This ensures no new errors creep into the code due to ignored rules
and allows chipping away at existing errors easily.
ADmad 7 years ago
parent
commit
d817c4f222
2 changed files with 4054 additions and 163 deletions
  1. 4051 0
      psalm-baseline.xml
  2. 3 163
      psalm.xml

File diff suppressed because it is too large
+ 4051 - 0
psalm-baseline.xml


+ 3 - 163
psalm.xml

@@ -1,181 +1,21 @@
 <?xml version="1.0"?>
 <psalm
-    totallyTyped="false"
     allowCoercionFromStringToClassConst="true"
     allowStringToStandInForClass="true"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="https://getpsalm.org/schema/config"
     xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
+    errorBaseline="psalm-baseline.xml"
 >
     <projectFiles>
         <directory name="src" />
         <ignoreFiles>
-            <directory name="src/TestSuite" />
-            <directory name="src/Filesystem"/>
+            <directory name="src/Filesystem" />
+            <directory name="vendor" />
         </ignoreFiles>
     </projectFiles>
 
     <issueHandlers>
         <LessSpecificReturnType errorLevel="info" />
-
-        <!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
-
-        <MissingClosureReturnType errorLevel="info" />
-        <MissingPropertyType errorLevel="info" />
-
-        <PropertyNotSetInConstructor errorLevel="info" />
-        <MissingConstructor>
-            <errorLevel type="suppress">
-                <file name="src/Cache/Engine/MemcachedEngine.php" />
-                <file name="src/Cache/Engine/RedisEngine.php" />
-                <file name="src/Console/HelperRegistry.php" />
-                <file name="src/Http/Client/Adapter/Stream.php" />
-                <file name="src/Http/Client/FormData.php" />
-                <file name="src/Http/Runner.php" />
-            </errorLevel>
-        </MissingConstructor>
-        <MissingClosureParamType errorLevel="info" />
-        <MissingParamType errorLevel="info" />
-
-        <RedundantCondition>
-            <errorLevel type="suppress">
-                <file name="src/Utility/Hash.php" />
-            </errorLevel>
-        </RedundantCondition>
-
-        <DocblockTypeContradiction errorLevel="info" />
-        <RedundantConditionGivenDocblockType errorLevel="info" />
-
-        <UnresolvableInclude errorLevel="info" />
-
-        <!-- level 4 issues - points to possible deficiencies in logic, higher false-positives -->
-
-        <MoreSpecificReturnType errorLevel="info" />
-        <LessSpecificReturnStatement errorLevel="info" />
-        <TypeCoercion errorLevel="info" />
-
-        <PossiblyInvalidArrayAccess errorLevel="info" />
-        <PossiblyInvalidArrayOffset errorLevel="info" />
-        <PossiblyInvalidFunctionCall errorLevel="info" />
-        <PossiblyInvalidIterator errorLevel="info" />
-        <PossiblyInvalidMethodCall errorLevel="info" />
-        <PossiblyInvalidOperand errorLevel="info" />
-        <PossiblyInvalidPropertyAssignment errorLevel="info" />
-        <PossiblyNullArgument errorLevel="info" />
-        <PossiblyNullArrayAccess errorLevel="info" />
-        <PossiblyNullArrayAssignment errorLevel="info" />
-        <PossiblyNullArrayOffset errorLevel="info" />
-        <PossiblyNullOperand errorLevel="info" />
-        <PossiblyNullPropertyAssignment errorLevel="info" />
-        <PossiblyNullPropertyAssignmentValue errorLevel="info" />
-        <PossiblyNullPropertyFetch errorLevel="info" />
-        <PossiblyNullReference errorLevel="info" />
-
-        <!-- level 5 issues - should be avoided at mosts costs... -->
-
-        <InvalidScalarArgument errorLevel="info" />
-        <InvalidOperand errorLevel="info" />
-        <NoInterfaceProperties errorLevel="info" />
-        <TypeDoesNotContainType errorLevel="info" />
-        <TypeDoesNotContainNull errorLevel="info" />
-        <ImplementedReturnTypeMismatch errorLevel="info" />
-
-        <!-- level 6 issues - really bad things -->
-
-        <NullableReturnStatement>
-            <errorLevel type="suppress">
-                <file name="src/Utility/Inflector.php" />
-            </errorLevel>
-        </NullableReturnStatement>
-
-        <MoreSpecificImplementedParamType errorLevel="info" />
-        <LessSpecificImplementedReturnType errorLevel="info" />
-
-        <!-- level 7 issues - even worse -->
-        <InvalidArgument errorLevel="info" />
-
-        <InvalidPropertyAssignmentValue>
-            <errorLevel type="suppress">
-                <file name="src/I18n/DateFormatTrait.php" />
-            </errorLevel>
-        </InvalidPropertyAssignmentValue>
-
-        <!-- CakePHP Specific -->
-        <DeprecatedClass>
-            <errorLevel type="suppress">
-                <file name="src/Console/Shell.php" />
-                <file name="src/Console/ShellDispatcher.php" />
-                <directory name="src/Shell" />
-            </errorLevel>
-        </DeprecatedClass>
-
-        <PossiblyUndefinedArrayOffset>
-            <errorLevel type="suppress">
-                <file name="src/Database/Driver/Mysql.php" />
-                <file name="src/I18n/Parser/PoFileParser.php" />
-                <file name="src/Database/Schema/SqlserverSchema.php" />
-                <file name="src/Http/ResponseEmitter.php" />
-                <file name="src/View/Helper/PaginatorHelper.php" />
-                <file name="src/View/Widget/RadioWidget.php" />
-            </errorLevel>
-        </PossiblyUndefinedArrayOffset>
-
-        <UndefinedConstant errorLevel="suppress" />
-
-        <UndefinedPropertyAssignment>
-            <errorLevel type="suppress">
-                <file name="src/Core/StaticConfigTrait.php" />
-                <file name="src/Database/Log/LoggingStatement.php" />
-                <file name="src/Http/ServerRequestFactory.php" />
-            </errorLevel>
-        </UndefinedPropertyAssignment>
-
-        <UndefinedPropertyFetch>
-            <errorLevel type="suppress">
-                <file name="src/Core/StaticConfigTrait.php" />
-            </errorLevel>
-        </UndefinedPropertyFetch>
-
-        <EmptyArrayAccess>
-            <errorLevel type="suppress">
-                <file name="src/Database/Dialect/SqlserverDialectTrait.php" />
-            </errorLevel>
-        </EmptyArrayAccess>
-
-        <LoopInvalidation>
-            <errorLevel type="suppress">
-                <file name="src/View/Form/EntityContext.php" />
-                <file name="src/Core/Configure/Engine/IniConfig.php" />
-            </errorLevel>
-        </LoopInvalidation>
-
-        <UndefinedClass>
-            <errorLevel type="suppress">
-                <file name="src/Cache/Engine/MemcachedEngine.php" />
-                <file name="src/Cache/Engine/RedisEngine.php" />
-                <file name="src/ORM/Behavior/Translate/EavStrategy.php" />
-            </errorLevel>
-        </UndefinedClass>
-
-        <UndefinedMethod>
-            <errorLevel type="suppress">
-                <file name="src/Console/Shell.php" />
-                <file name="src/Controller/Component/AuthComponent.php" />
-            </errorLevel>
-        </UndefinedMethod>
-
-        <NullReference>
-            <errorLevel type="suppress">
-                <file name="src/Database/Driver.php" />
-            </errorLevel>
-        </NullReference>
-
-        <PossiblyUndefinedMethod>
-            <errorLevel type="suppress">
-                <file name="src/ORM/LazyEagerLoader.php" />
-                <file name="src/View/XmlView.php" />
-            </errorLevel>
-        </PossiblyUndefinedMethod>
-
     </issueHandlers>
 </psalm>