-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathmago.src.toml
More file actions
101 lines (95 loc) · 3.65 KB
/
Copy pathmago.src.toml
File metadata and controls
101 lines (95 loc) · 3.65 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#:schema https://mago.carthage.software/1.40.2/schema.json
version = "1"
php-version = "8.2.0"
[source]
workspace = "."
paths = ["."]
includes = ["vendor"]
excludes = []
[source.glob]
literal-separator = true
[formatter]
print-width = 120
tab-width = 4
use-tabs = false
[linter]
integrations = []
[linter.rules]
# tcpdf.php is the historical file name of the TCPDF class and is part of the
# public contract (require_once paths in user code); it cannot be renamed.
file-name = { enabled = false }
# tcpdf.php must not declare strict_types: the legacy API relies on loose
# argument coercion, and calls into typed tc-lib methods must keep coercing
# loosely-typed user input exactly as the original implementation did.
strict-types = { enabled = false }
ambiguous-function-call = { enabled = false }
literal-named-argument = { enabled = false }
cyclomatic-complexity = { enabled = false }
excessive-parameter-list = { enabled = false }
halstead = { enabled = false, effort-threshold = 7000 }
identity-comparison = { enabled = true }
kan-defect = { enabled = false }
no-boolean-flag-parameter = { enabled = false }
no-else-clause = { enabled = false }
no-empty = { enabled = true }
excessive-nesting = { enabled = true, threshold = 10, function-like-threshold = 10 }
too-many-methods = { enabled = false }
no-isset = { enabled = true, allow-array-checks = true }
# The facade owns the legacy stateful model (cursor, fonts, colors, margins,
# header/footer, ...) as properties; the original class had 200+.
too-many-properties = { enabled = true, threshold = 100 }
no-insecure-comparison = { enabled = true, exclude = ["src/HTML.php", "src/JavaScript.php"] }
no-literal-password = { enabled = true, exclude = ["src/HTML.php"] }
[analyzer]
plugins = []
# The legacy TCPDF public API is intentionally untyped (see
# check-missing-type-hints below): every legacy argument enters as `mixed`
# and is coerced with PHP cast semantics exactly as the original
# implementation did. The issue codes below flag each of those intentional
# legacy coercion sites and are suppressed for that reason.
ignore = [
"invalid-type-cast",
"mixed-operand",
"mixed-assignment",
]
find-unused-definitions = true
find-unused-expressions = true
analyze-dead-code = true
memoize-properties = true
check-throws = true
# The legacy TCPDF API has no checked-exception contract: every public method
# may abort via Error(), which throws. The tc-lib exceptions bubbling through
# the facade are part of that same "throws on failure" contract.
unchecked-exceptions = [
"Error",
"LogicException",
"ReflectionException",
"Exception",
"RuntimeException",
"Random\\RandomException",
"Com\\Tecnick\\Pdf\\Exception",
"Com\\Tecnick\\Pdf\\Page\\Exception",
"Com\\Tecnick\\Pdf\\Font\\Exception",
"Com\\Tecnick\\Pdf\\Image\\Exception",
"Com\\Tecnick\\Pdf\\Graph\\Exception",
"Com\\Tecnick\\Pdf\\Encrypt\\Exception",
"Com\\Tecnick\\Color\\Exception",
"Com\\Tecnick\\Unicode\\Exception",
"Com\\Tecnick\\File\\Exception",
"Com\\Tecnick\\Barcode\\Exception",
# The engine output and HTML methods declare "@throws \Throwable".
"Throwable",
]
unchecked-exception-classes = []
check-missing-override = true
find-unused-parameters = true
strict-list-index-checks = true
strict-array-index-existence = true
allow-array-truthy-operand = false
no-boolean-literal-comparison = true
# The legacy TCPDF public API is intentionally untyped: adding native parameter or
# return types to the 291 published method signatures would change the public
# contract (subclass overrides, coercion behavior), which is forbidden for this
# compatibility facade. Internal (private) code must still use native types.
check-missing-type-hints = false
register-super-globals = true