Commit Graph
7 Commits
Author SHA1 Message Date
Damodar Lohani ec628b1ff5 fix: declare spyc directly and align DetectorTest with rector
Removing matomo/device-detector also dropped mustangostang/spyc, which
Compose.php uses directly as a yaml_parse fallback via Spyc::YAMLLoadString.
Declare it as a direct dependency instead of relying on the transitive pull.

Switch the new DetectorTest assertions to assertSame to satisfy the
refactor:check Rector rule.
2026-07-21 09:08:52 +05:45
Damodar Lohani 661aa8124e feat: use utopia-php/user-agent for user-agent parsing
Rewrites Appwrite\Detector\Detector to wrap utopia-php/user-agent instead
of matomo/device-detector. The public shape (getOS/getClient/getDevice/
skipBotDetection) is unchanged, so the four call sites are untouched. The
AppwriteCLI short-circuit and the ''-vs-null defaults (os/client default to
'', device fields to null) are preserved.

matomo/device-detector is removed from composer — it was used only through
this wrapper, and isBot() was never called anywhere. utopia-php/user-agent
requires PHP >=8.4, already satisfied by the >=8.5 floor on main.

utopia 0.1.1 keeps Matomo-aligned short codes, so parsing is byte-identical
for the tested user agents (Firefox 47 unit test; Chrome 70 and Chrome
Mobile e2e session and webhook assertions). Expands DetectorTest with the
AppwriteCLI branch, a mobile client, and the unknown-user-agent defaults.
2026-07-21 08:56:33 +05:45
Chirag Aggarwal 1baf576299 Initialize Rector for PHPUnit tests (#12495) 2026-06-04 18:19:56 +05:30
Torsten Dittmann bf9533007b tests: fix unit tests 2022-08-01 12:22:04 +02:00
Everly Precia Suresh 19300ccdd7 format files in app, src, tests 2022-05-23 14:54:50 +00:00
Eldad Fux 933954526e Fixed test 2021-02-22 14:30:28 +02:00
Eldad Fux 368bbe848e Added tests 2021-02-14 19:54:21 +02:00