# mago — PHP formatter + linter for this repo's PHP files.
# https://mago.carthage.software
#
# Scope: the PHP files here are test fixtures, benchmarks, and embed scripts for
# a PHP *extension* written in Rust. They are not application code. `analyze`
# (type checking) and `guard` (architecture) are intentionally not used: the
# fixtures call extension-registered symbols that only exist at PHP runtime.
= "8.1" # support floor; also flags 8.2+ syntax that would not run on the oldest supported PHP
[]
= ["tests", "benches", "src"] # mago only processes *.php; this captures every PHP file plus any added later
= ["php"]
[]
= "psr-12"
# Every rule below is disabled because it conflicts with the deliberate shape of
# the fixtures, not for convenience. Keep this list honest: if a disable is no
# longer justified by fixture intent, re-enable it.
[]
= { = false } # fixtures pass literals positionally to assert()/test fns by design
= { = false } # bare assert() is the fixture idiom
= { = false } # declare(strict_types=1) would change coercion across behavior-sensitive fixtures
= { = false } # forcing in_array() strict comparison can change what is asserted
= { = false } # debug_zval_dump is a documented refcount-testing tool (see CONTEXT.md)
= { = false } # empty catch blocks are intentional in exception-throwing tests
= { = false } # fixtures are named by what they test, not by their class name
= { = false } # isset is the subject under test (e.g. the __isset magic method)
= { = false } # fixtures define several test classes in one file
= { = false } # the @ operator is intentional in the error-observer test
= { = false } # getenv(...) ?: 'default' is the deliberate runtime env-or-default pattern (a full ternary would double-evaluate getenv())