Repository navigation
Expand file tree
/
Copy pathmago.toml
More file actions
79 lines (71 loc) · 3.38 KB
/
Copy pathmago.toml
File metadata and controls
79 lines (71 loc) · 3.38 KB
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
extends = "vendor/php-db/phpdb-qa-tools/mago.toml"
php-version = "8.3.0"
[source]
paths = ["src", "test"]
includes = ["vendor"]
[formatter]
parentheses-around-new-in-member-access = true
[linter]
baseline = "lint-baseline.toml"
[linter.rules]
# Exception classes are message catalogues: one template and one named constructor per
# condition, per the convention in docs/book/exceptions.md. The method count tracks the
# number of distinct failures a component can report, so the maintainability signal does
# not apply. Predicate, AlterTable, CreateTable, Select, Insert and Update are fluent builders:
# one public method per clause they can emit, so their method count is the size of their
# public API. AbstractSql is their base and carries one protected hook per clause it renders.
# ConnectionInterface and PlatformInterface are the contracts every driver and platform package
# implements, so their method count is the size of that contract. Pdo\Result implements Iterator,
# Countable and ResultInterface, and ParameterContainer implements Iterator, ArrayAccess and
# Countable beside its errata and max-length accessors: in both, the count is fixed by the
# interfaces and the public API.
# "test/" repeats the phpdb-qa-tools default, which this key replaces.
too-many-methods = { exclude = [
"test/",
"src/Adapter/Driver/ConnectionInterface.php",
"src/Adapter/Driver/Pdo/Result.php",
"src/Adapter/ParameterContainer.php",
"src/Adapter/Platform/PlatformInterface.php",
"src/Sql/Exception/",
"src/Sql/Predicate/Exception/",
"src/TableGateway/Exception/",
"src/Adapter/Exception/",
"src/Sql/Predicate/Predicate.php",
"src/Sql/Ddl/AlterTable.php",
"src/Sql/Ddl/CreateTable.php",
"src/Sql/AbstractSql.php",
"src/Sql/Select.php",
"src/Sql/Insert.php",
"src/Sql/Update.php",
] }
# Select holds one property per clause of a SELECT statement.
too-many-properties = { exclude = ["src/Sql/Select.php"] }
# These constructors take one argument per part of the SQL definition they model
# (a foreign key's name, columns, reference table, reference columns and two rules; a
# column's name, digits, scale, nullability, default and options). They are public API, so
# the list cannot be shortened without breaking callers.
excessive-parameter-list = { exclude = [
"src/Sql/Ddl/Constraint/ForeignKey.php",
"src/Sql/Ddl/Column/AbstractPrecisionColumn.php",
] }
# The capability interfaces return `ResultSetInterface&<themselves>`, and PHP rejects
# `self` as part of an intersection type, so this rule's advice cannot be taken there.
prefer-self-return-type = { exclude = [
"src/ResultSet/ArrayObjectResultSetInterface.php",
"src/ResultSet/HydratingResultSetInterface.php",
"src/ResultSet/RowPrototypeResultSetInterface.php",
] }
[analyzer]
baseline = "analyzer-baseline.toml"
# ArgumentType is string-backed and each case's value is a ::class constant, which PHP accepts
# as a string. The analyzer reports the class-string type as not being a string.
ignore = [
{ code = "invalid-enum-case-value", in = ["src/Sql/ArgumentType.php"] },
]
class-initializers = [
"PhpDb\\Adapter\\Driver\\Pdo\\Statement::initialize",
"PhpDb\\Adapter\\Driver\\Pdo\\Statement::setDriver",
"PhpDb\\ResultSet\\AbstractResultSet::initialize",
"PhpDb\\TableGateway\\Feature\\AbstractFeature::setTableGateway",
"PhpDb\\RowGateway\\Feature\\AbstractFeature::setRowGateway",
]