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.
This commit is contained in:
Damodar Lohani committed 2026-07-21 09:08:52 +05:45
1 parent 661aa8124e
commit ec628b1ff5
3 files changed
+60 -5

No files matched your search

+1
View File
@@ -95,6 +95,7 @@
"utopia-php/system": "0.10.*",
"utopia-php/telemetry": "^0.4",
"utopia-php/user-agent": "0.1.*",
"mustangostang/spyc": "0.6.*",
"utopia-php/vcs": "^4.4.2",
"utopia-php/websocket": "1.0.*",
"dragonmantank/cron-expression": "3.4.*",
Generated
+55 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "38ff4f69a268151556ee8776b1afab39",
"content-hash": "f9e477526d52de114f4bc6b07ebd21ea",
"packages": [
{
"name": "adhocore/jwt",
@@ -877,6 +877,60 @@
},
"time": "2025-10-06T12:12:40+00:00"
},
{
"name": "mustangostang/spyc",
"version": "0.6.3",
"source": {
"type": "git",
"url": "https://github.com/mustangostang/spyc.git",
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0",
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0",
"shasum": ""
},
"require": {
"php": ">=5.3.1"
},
"require-dev": {
"phpunit/phpunit": "4.3.*@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.5.x-dev"
}
},
"autoload": {
"files": [
"Spyc.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "mustangostang",
"email": "vlad.andersen@gmail.com"
}
],
"description": "A simple YAML loader/dumper class for PHP",
"homepage": "https://github.com/mustangostang/spyc/",
"keywords": [
"spyc",
"yaml",
"yml"
],
"support": {
"issues": "https://github.com/mustangostang/spyc/issues",
"source": "https://github.com/mustangostang/spyc/tree/0.6.3"
},
"time": "2019-09-10T13:16:29+00:00"
},
{
"name": "nyholm/psr7",
"version": "1.8.2",
+4 -4
View File
@@ -54,9 +54,9 @@ final class DetectorTest extends TestCase
{
$detector = new Detector('Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1');
$this->assertEquals(['osCode' => 'IOS', 'osName' => 'iOS', 'osVersion' => '17.0'], $detector->getOS());
$this->assertSame(['osCode' => 'IOS', 'osName' => 'iOS', 'osVersion' => '17.0'], $detector->getOS());
$this->assertEquals('MF', $detector->getClient()['clientCode']);
$this->assertEquals([
$this->assertSame([
'deviceName' => 'smartphone',
'deviceBrand' => 'Apple',
'deviceModel' => 'iPhone',
@@ -67,7 +67,7 @@ final class DetectorTest extends TestCase
{
$detector = new Detector('AppwriteCLI/2.0.0 (linux; x64) node/18.0.0');
$this->assertEquals([
$this->assertSame([
'clientType' => 'desktop',
'clientCode' => 'cli',
'clientName' => 'Appwrite CLI',
@@ -82,7 +82,7 @@ final class DetectorTest extends TestCase
$detector = new Detector('');
// OS and client fields default to an empty string, device fields to null.
$this->assertEquals(['osCode' => '', 'osName' => '', 'osVersion' => ''], $detector->getOS());
$this->assertSame(['osCode' => '', 'osName' => '', 'osVersion' => ''], $detector->getOS());
$this->assertEquals('', $detector->getClient()['clientType']);
$this->assertEquals([
'deviceName' => null,