File: phpstan.neon.dist

package info (click to toggle)
php-doctrine-dbal 4.3.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,092 kB
  • sloc: php: 60,293; xml: 618; makefile: 23
file content (111 lines) | stat: -rw-r--r-- 5,095 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
parameters:
    level: 8
    phpVersion: 80402
    paths:
        - src
        - static-analysis
        - tests
    treatPhpDocTypesAsCertain: false
    reportUnmatchedIgnoredErrors: false
    exceptions:
        check:
            missingCheckedExceptionInThrows: true
        uncheckedExceptionClasses:
            - ErrorException
            - LogicException
            - RuntimeException
    ignoreErrors:
        - identifier: missingType.generics

        # Ignore missing declarations of checked exceptions in tests
        -
            identifier: missingType.checkedException
            paths:
                - static-analysis
                - tests

        # https://github.com/phpstan/phpstan-strict-rules/issues/103
        -
            message: '~^Construct empty\(\) is not allowed. Use more strict comparison\.~'
            paths:
                - src/Connections/PrimaryReadReplicaConnection.php
                - src/Driver/*/Driver.php
                - src/Driver/AbstractOracleDriver/EasyConnectString.php
                - src/Platforms/*Platform.php
                - src/Schema/*SchemaManager.php
                - tests/TestUtil.php

        # In some namespaces, we use array<string,mixed>, some elements of which are actually boolean
        -
            message: '~^Only booleans are allowed in .*, mixed given~'
            paths:
                - src/Platforms/*Platform.php
                - src/Schema/*SchemaManager.php

        # Some APIs use variable method calls internally
        -
            message: '~^Variable method call on .*~'
            paths:
                - src/Schema/Column.php

        # https://github.com/phpstan/phpstan/issues/4679
        -
            message: '~^Cannot call method writeTemporary\(\) on OCILob\|null\.$~'
            paths:
                - src/Driver/OCI8/Statement.php

        # We're testing with invalid input.
        -
            message: '~array{driver: ''invalid_driver''} given\.$~'
            path: tests/DriverManagerTest.php
        -
            message: '~array{driver: ''pdo_sqlite'', memory: true, wrapperClass: ''stdClass''} given\.$~'
            path: tests/DriverManagerTest.php
        -
            message: '~array{driverClass: ''stdClass''} given\.$~'
            path: tests/DriverManagerTest.php
        -
            message: '~^Parameter #1 \$driverOptions of method Doctrine\\DBAL\\Tests\\Functional\\Driver\\Mysqli\\ConnectionTest\:\:getConnection\(\) expects array<string, mixed>, .* given\.$~'
            path: tests/Functional/Driver/Mysqli/ConnectionTest.php
        -
            message: '~^Parameter #1 \$params of method Doctrine\\DBAL\\Driver\:\:connect\(\) expects array~'
            path: tests/Driver/PDO/*/DriverTest.php

        # There is no way to make this assertion in the code,
        # and the API doesn't support parametrization of returned column types.
        -
            message: '~^Method Doctrine\\DBAL\\Schema\\PostgreSQLSchemaManager::fetchTableOptionsByTable\(\) should return array<string, array<string, mixed>> but returns array<int\|string, array<string, mixed>>\.$~'
            paths:
                - src/Schema/PostgreSQLSchemaManager.php

        # We don't need to declare the return type *that* fine-grained.
        - '~^Method Doctrine\\DBAL\\Driver\\PDO\\Statement\:\:convertParamType\(\) never returns \d+ so it can be removed from the return type\.$~'

        # PHPStan does not understand the array shapes returned by pg_fetch_*() methods.
        - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapAssociativeRow\(\) expects array<string, string\|null>, array<int\|string, string\|null> given\.$~'
        - '~^Parameter #1 \$row of method Doctrine\\DBAL\\Driver\\PgSQL\\Result\:\:mapNumericRow\(\) expects list<string\|null>, .* given\.$~'

        # Required for Psalm compatibility
        - '~^Property Doctrine\\DBAL\\Tests\\Types\\BaseDateTypeTestCase\:\:\$currentTimezone \(non-empty-string\) does not accept string\.$~'

        # The @throws annotations are part of a contract. Even if the default implementation doen't throw those
        # exceptions, the child implementations might do so.
        -
            identifier: throws.unusedType
            path: src/Types/Type.php

        # We don't narrow the return type of lastInsertId() yet.
        - '/^Method Doctrine\\DBAL\\Driver\\.+\\Connection\:\:lastInsertId\(\) never returns (int|false) so it can be removed from the return type\.$/'

        # Type check for legacy implementations of the Result interface
        # TODO: remove in 5.0.0
        - '~^Call to function method_exists\(\) with Doctrine\\DBAL\\Driver\\Result and ''getColumnName'' will always evaluate to true\.$~'

        # TODO: Review these errors and fix them.
        - identifier: phpunit.assertEquals
includes:
    - phpstan-baseline.neon
    - phar://phpstan.phar/conf/bleedingEdge.neon
    - vendor/phpstan/phpstan-phpunit/extension.neon
    - vendor/phpstan/phpstan-phpunit/rules.neon
    - vendor/phpstan/phpstan-strict-rules/rules.neon