diff --git a/composer.json b/composer.json index 43e10d8..80e53b7 100644 --- a/composer.json +++ b/composer.json @@ -33,14 +33,14 @@ "utopia-php/preloader": "0.2.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.18.*", - "utopia-php/system": "0.9.*" + "utopia-php/system": "0.10.*" }, "require-dev": { "laravel/pint": "1.*", "phpstan/phpstan": "2.*", "phpunit/phpunit": "9.*", - "swoole/ide-helper": "5.1.2", - "rector/rector": "2.3.1" + "rector/rector": "2.3.8", + "swoole/ide-helper": "5.1.2" }, "config": { "platform": { diff --git a/composer.lock b/composer.lock index 82e570a..b722701 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b15d6c7bf4f50618ffb727a7631f49fb", + "content-hash": "e18bdec90d703c20173a98f4a3949f88", "packages": [ { "name": "brick/math", - "version": "0.14.1", + "version": "0.14.8", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "f05858549e5f9d7bb45875a75583240a38a281d0" + "reference": "63422359a44b7f06cae63c3b429b59e8efcc0629" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/f05858549e5f9d7bb45875a75583240a38a281d0", - "reference": "f05858549e5f9d7bb45875a75583240a38a281d0", + "url": "https://api.github.com/repos/brick/math/zipball/63422359a44b7f06cae63c3b429b59e8efcc0629", + "reference": "63422359a44b7f06cae63c3b429b59e8efcc0629", "shasum": "" }, "require": { @@ -56,7 +56,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.14.1" + "source": "https://github.com/brick/math/tree/0.14.8" }, "funding": [ { @@ -64,7 +64,7 @@ "type": "github" } ], - "time": "2025-11-24T14:40:29+00:00" + "time": "2026-02-10T14:33:43+00:00" }, { "name": "composer/semver", @@ -145,16 +145,16 @@ }, { "name": "google/protobuf", - "version": "v4.33.4", + "version": "v4.33.5", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402" + "reference": "ebe8010a61b2ae0cff0d246fe1c4d44e9f7dfa6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/22d28025cda0d223a2e48c2e16c5284ecc9f5402", - "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ebe8010a61b2ae0cff0d246fe1c4d44e9f7dfa6d", + "reference": "ebe8010a61b2ae0cff0d246fe1c4d44e9f7dfa6d", "shasum": "" }, "require": { @@ -183,9 +183,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.4" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.5" }, - "time": "2026-01-12T17:58:43+00:00" + "time": "2026-01-29T20:49:00+00:00" }, { "name": "nyholm/psr7", @@ -333,16 +333,16 @@ }, { "name": "open-telemetry/api", - "version": "1.7.1", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "45bda7efa8fcdd9bdb0daa2f26c8e31f062f49d4" + "reference": "df5197c6fd0ddd8e9883b87de042d9341300e2ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/45bda7efa8fcdd9bdb0daa2f26c8e31f062f49d4", - "reference": "45bda7efa8fcdd9bdb0daa2f26c8e31f062f49d4", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/df5197c6fd0ddd8e9883b87de042d9341300e2ad", + "reference": "df5197c6fd0ddd8e9883b87de042d9341300e2ad", "shasum": "" }, "require": { @@ -352,7 +352,7 @@ "symfony/polyfill-php82": "^1.26" }, "conflict": { - "open-telemetry/sdk": "<=1.0.8" + "open-telemetry/sdk": "<=1.11" }, "type": "library", "extra": { @@ -399,7 +399,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-10-19T10:49:48+00:00" + "time": "2026-01-21T04:14:03+00:00" }, { "name": "open-telemetry/context", @@ -462,16 +462,16 @@ }, { "name": "open-telemetry/exporter-otlp", - "version": "1.3.4", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/exporter-otlp.git", - "reference": "62e680d587beb42e5247aa6ecd89ad1ca406e8ca" + "reference": "283a0d66522f2adc6d8d7debfd7686be91c282be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/62e680d587beb42e5247aa6ecd89ad1ca406e8ca", - "reference": "62e680d587beb42e5247aa6ecd89ad1ca406e8ca", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/283a0d66522f2adc6d8d7debfd7686be91c282be", + "reference": "283a0d66522f2adc6d8d7debfd7686be91c282be", "shasum": "" }, "require": { @@ -522,7 +522,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2026-01-15T09:31:34+00:00" + "time": "2026-02-05T09:44:52+00:00" }, { "name": "open-telemetry/gen-otlp-protobuf", @@ -589,16 +589,16 @@ }, { "name": "open-telemetry/sdk", - "version": "1.11.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "d91f21addcdb42da9a451c002777f8318432461a" + "reference": "c76f91203bf7ef98ab3f4e0a82ca21699af185e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/d91f21addcdb42da9a451c002777f8318432461a", - "reference": "d91f21addcdb42da9a451c002777f8318432461a", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/c76f91203bf7ef98ab3f4e0a82ca21699af185e1", + "reference": "c76f91203bf7ef98ab3f4e0a82ca21699af185e1", "shasum": "" }, "require": { @@ -639,7 +639,7 @@ ] }, "branch-alias": { - "dev-main": "1.9.x-dev" + "dev-main": "1.12.x-dev" } }, "autoload": { @@ -682,20 +682,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2026-01-15T11:21:03+00:00" + "time": "2026-01-28T11:38:11+00:00" }, { "name": "open-telemetry/sem-conv", - "version": "1.37.0", + "version": "1.38.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sem-conv.git", - "reference": "8da7ec497c881e39afa6657d72586e27efbd29a1" + "reference": "e613bc640a407def4991b8a936a9b27edd9a3240" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/8da7ec497c881e39afa6657d72586e27efbd29a1", - "reference": "8da7ec497c881e39afa6657d72586e27efbd29a1", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/e613bc640a407def4991b8a936a9b27edd9a3240", + "reference": "e613bc640a407def4991b8a936a9b27edd9a3240", "shasum": "" }, "require": { @@ -735,11 +735,11 @@ ], "support": { "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", - "docs": "https://opentelemetry.io/docs/php", + "docs": "https://opentelemetry.io/docs/languages/php", "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-09-03T12:08:10+00:00" + "time": "2026-01-21T04:14:03+00:00" }, { "name": "php-http/discovery", @@ -1306,16 +1306,16 @@ }, { "name": "symfony/http-client", - "version": "v7.4.3", + "version": "v7.4.6", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "d01dfac1e0dc99f18da48b18101c23ce57929616" + "reference": "2bde8afd5ab2fe0b05a9c2d4c3c0e28ceb98a154" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/d01dfac1e0dc99f18da48b18101c23ce57929616", - "reference": "d01dfac1e0dc99f18da48b18101c23ce57929616", + "url": "https://api.github.com/repos/symfony/http-client/zipball/2bde8afd5ab2fe0b05a9c2d4c3c0e28ceb98a154", + "reference": "2bde8afd5ab2fe0b05a9c2d4c3c0e28ceb98a154", "shasum": "" }, "require": { @@ -1383,7 +1383,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.4.3" + "source": "https://github.com/symfony/http-client/tree/v7.4.6" }, "funding": [ { @@ -1403,7 +1403,7 @@ "type": "tidelift" } ], - "time": "2025-12-23T14:50:43+00:00" + "time": "2026-02-18T09:46:18+00:00" }, { "name": "symfony/http-client-contracts", @@ -2054,22 +2054,22 @@ }, { "name": "utopia-php/framework", - "version": "0.34.12", + "version": "0.34.14", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "3571c4948f6883a2e56e8979dc901a63a762dc45" + "reference": "d60c9ce7eea3e4f89599d995e0058e3729a1ef7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/3571c4948f6883a2e56e8979dc901a63a762dc45", - "reference": "3571c4948f6883a2e56e8979dc901a63a762dc45", + "url": "https://api.github.com/repos/utopia-php/http/zipball/d60c9ce7eea3e4f89599d995e0058e3729a1ef7c", + "reference": "d60c9ce7eea3e4f89599d995e0058e3729a1ef7c", "shasum": "" }, "require": { "ext-swoole": "*", "php": ">=8.0", - "utopia-php/validators": "0.1.*" + "utopia-php/validators": "0.2.*" }, "require-dev": { "laravel/pint": "1.*", @@ -2098,9 +2098,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.34.12" + "source": "https://github.com/utopia-php/http/tree/0.34.14" }, - "time": "2025-12-18T08:19:56+00:00" + "time": "2026-02-25T17:31:12+00:00" }, { "name": "utopia-php/orchestration", @@ -2259,37 +2259,31 @@ }, { "name": "utopia-php/storage", - "version": "0.18.22", + "version": "0.18.26", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "c46bd78c1f52281df89f8921159782b20260ce31" + "reference": "b167d580bb61295a8bab2caece80613fc06d0f44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/c46bd78c1f52281df89f8921159782b20260ce31", - "reference": "c46bd78c1f52281df89f8921159782b20260ce31", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/b167d580bb61295a8bab2caece80613fc06d0f44", + "reference": "b167d580bb61295a8bab2caece80613fc06d0f44", "shasum": "" }, "require": { - "ext-brotli": "*", "ext-curl": "*", "ext-fileinfo": "*", - "ext-lz4": "*", "ext-simplexml": "*", - "ext-snappy": "*", - "ext-xz": "*", "ext-zlib": "*", - "ext-zstd": "*", "php": ">=8.1", "utopia-php/system": "0.*.*", "utopia-php/telemetry": "0.2.*", - "utopia-php/validators": "0.1.*" + "utopia-php/validators": "0.2.*" }, "require-dev": { - "laravel/pint": "1.2.*", - "phpunit/phpunit": "^9.3", - "vimeo/psalm": "4.0.1" + "laravel/pint": "^1.21", + "phpunit/phpunit": "^9.3" }, "type": "library", "autoload": { @@ -2311,22 +2305,22 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.22" + "source": "https://github.com/utopia-php/storage/tree/0.18.26" }, - "time": "2026-01-15T01:36:39+00:00" + "time": "2026-02-26T11:50:13+00:00" }, { "name": "utopia-php/system", - "version": "0.9.0", + "version": "0.10.0", "source": { "type": "git", "url": "https://github.com/utopia-php/system.git", - "reference": "8e4a7edaf2dfeb4c9524e9f766d27754f2c4b64d" + "reference": "6441a9c180958a373e5ddb330264dd638539dfdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/system/zipball/8e4a7edaf2dfeb4c9524e9f766d27754f2c4b64d", - "reference": "8e4a7edaf2dfeb4c9524e9f766d27754f2c4b64d", + "url": "https://api.github.com/repos/utopia-php/system/zipball/6441a9c180958a373e5ddb330264dd638539dfdb", + "reference": "6441a9c180958a373e5ddb330264dd638539dfdb", "shasum": "" }, "require": { @@ -2334,7 +2328,7 @@ }, "require-dev": { "laravel/pint": "1.13.*", - "phpstan/phpstan": "1.10.*", + "phpstan/phpstan": "1.12.*", "phpunit/phpunit": "9.6.*" }, "type": "library", @@ -2367,9 +2361,9 @@ ], "support": { "issues": "https://github.com/utopia-php/system/issues", - "source": "https://github.com/utopia-php/system/tree/0.9.0" + "source": "https://github.com/utopia-php/system/tree/0.10.0" }, - "time": "2024-10-09T14:44:01+00:00" + "time": "2025-10-15T19:12:00+00:00" }, { "name": "utopia-php/telemetry", @@ -2428,16 +2422,16 @@ }, { "name": "utopia-php/validators", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/utopia-php/validators.git", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080" + "reference": "30b6030a5b100fc1dff34506e5053759594b2a20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/validators/zipball/5c57d5b6cf964f8981807c1d3ea8df620c869080", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080", + "url": "https://api.github.com/repos/utopia-php/validators/zipball/30b6030a5b100fc1dff34506e5053759594b2a20", + "reference": "30b6030a5b100fc1dff34506e5053759594b2a20", "shasum": "" }, "require": { @@ -2445,7 +2439,7 @@ }, "require-dev": { "laravel/pint": "1.*", - "phpstan/phpstan": "1.*", + "phpstan/phpstan": "2.*", "phpunit/phpunit": "11.*" }, "type": "library", @@ -2467,9 +2461,9 @@ ], "support": { "issues": "https://github.com/utopia-php/validators/issues", - "source": "https://github.com/utopia-php/validators/tree/0.1.0" + "source": "https://github.com/utopia-php/validators/tree/0.2.0" }, - "time": "2025-11-18T11:05:46+00:00" + "time": "2026-01-13T09:16:51+00:00" } ], "packages-dev": [ @@ -2544,16 +2538,16 @@ }, { "name": "laravel/pint", - "version": "v1.27.0", + "version": "v1.27.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "c67b4195b75491e4dfc6b00b1c78b68d86f54c90" + "reference": "54cca2de13790570c7b6f0f94f37896bee4abcb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/c67b4195b75491e4dfc6b00b1c78b68d86f54c90", - "reference": "c67b4195b75491e4dfc6b00b1c78b68d86f54c90", + "url": "https://api.github.com/repos/laravel/pint/zipball/54cca2de13790570c7b6f0f94f37896bee4abcb5", + "reference": "54cca2de13790570c7b6f0f94f37896bee4abcb5", "shasum": "" }, "require": { @@ -2564,13 +2558,13 @@ "php": "^8.2.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.92.4", - "illuminate/view": "^12.44.0", - "larastan/larastan": "^3.8.1", - "laravel-zero/framework": "^12.0.4", + "friendsofphp/php-cs-fixer": "^3.93.1", + "illuminate/view": "^12.51.0", + "larastan/larastan": "^3.9.2", + "laravel-zero/framework": "^12.0.5", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^2.3.3", - "pestphp/pest": "^3.8.4" + "pestphp/pest": "^3.8.5" }, "bin": [ "builds/pint" @@ -2607,7 +2601,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2026-01-05T16:49:17+00:00" + "time": "2026-02-10T20:00:20+00:00" }, { "name": "myclabs/deep-copy", @@ -2847,11 +2841,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.33", + "version": "2.1.40", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f", - "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", + "reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", "shasum": "" }, "require": { @@ -2896,7 +2890,7 @@ "type": "github" } ], - "time": "2025-12-05T10:24:31+00:00" + "time": "2026-02-23T15:04:35+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3219,16 +3213,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.31", + "version": "9.6.34", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "945d0b7f346a084ce5549e95289962972c4272e5" + "reference": "b36f02317466907a230d3aa1d34467041271ef4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/945d0b7f346a084ce5549e95289962972c4272e5", - "reference": "945d0b7f346a084ce5549e95289962972c4272e5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b36f02317466907a230d3aa1d34467041271ef4a", + "reference": "b36f02317466907a230d3aa1d34467041271ef4a", "shasum": "" }, "require": { @@ -3250,7 +3244,7 @@ "phpunit/php-timer": "^5.0.3", "sebastian/cli-parser": "^1.0.2", "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.9", + "sebastian/comparator": "^4.0.10", "sebastian/diff": "^4.0.6", "sebastian/environment": "^5.1.5", "sebastian/exporter": "^4.0.8", @@ -3302,7 +3296,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.31" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.34" }, "funding": [ { @@ -3326,25 +3320,25 @@ "type": "tidelift" } ], - "time": "2025-12-06T07:45:52+00:00" + "time": "2026-01-27T05:45:00+00:00" }, { "name": "rector/rector", - "version": "2.3.1", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "9afc1bb43571b25629f353c61a9315b5ef31383a" + "reference": "bbd37aedd8df749916cffa2a947cfc4714d1ba2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/9afc1bb43571b25629f353c61a9315b5ef31383a", - "reference": "9afc1bb43571b25629f353c61a9315b5ef31383a", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/bbd37aedd8df749916cffa2a947cfc4714d1ba2c", + "reference": "bbd37aedd8df749916cffa2a947cfc4714d1ba2c", "shasum": "" }, "require": { "php": "^7.4|^8.0", - "phpstan/phpstan": "^2.1.33" + "phpstan/phpstan": "^2.1.38" }, "conflict": { "rector/rector-doctrine": "*", @@ -3378,7 +3372,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/2.3.1" + "source": "https://github.com/rectorphp/rector/tree/2.3.8" }, "funding": [ { @@ -3386,7 +3380,7 @@ "type": "github" } ], - "time": "2026-01-13T15:13:58+00:00" + "time": "2026-02-22T09:45:50+00:00" }, { "name": "sebastian/cli-parser", @@ -3557,16 +3551,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.9", + "version": "4.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d", + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d", "shasum": "" }, "require": { @@ -3619,7 +3613,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10" }, "funding": [ { @@ -3639,7 +3633,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T06:51:50+00:00" + "time": "2026-01-24T09:22:56+00:00" }, { "name": "sebastian/complexity", @@ -4497,5 +4491,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.9.0" + "plugin-api-version": "2.6.0" } diff --git a/rector.php b/rector.php index cb1fc88..1a28847 100644 --- a/rector.php +++ b/rector.php @@ -4,6 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector; +use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector; return RectorConfig::configure() ->withPaths([ @@ -14,6 +15,7 @@ ->withSkipPath(__DIR__ . '/tests/resources') ->withSkip([ FinalizeTestCaseClassRector::class, + ThrowWithPreviousExceptionRector::class, ]) ->withPhpSets(php84: true) ->withComposerBased(phpunit: true) diff --git a/src/Executor/Runner/Docker.php b/src/Executor/Runner/Docker.php index 6e81be5..255e8c6 100644 --- a/src/Executor/Runner/Docker.php +++ b/src/Executor/Runner/Docker.php @@ -3,7 +3,7 @@ namespace OpenRuntimes\Executor\Runner; use OpenRuntimes\Executor\Logs; -use OpenRuntimes\Executor\Exception; +use OpenRuntimes\Executor\Exception as ExecutorException; use OpenRuntimes\Executor\Runner\Repository\Runtimes; use OpenRuntimes\Executor\StorageFactory; use OpenRuntimes\Executor\Validator\TCP; @@ -61,7 +61,7 @@ public function getLogs(string $runtimeId, int $timeout, Response $response): vo $checkStart = \microtime(true); while (true) { if (\microtime(true) - $checkStart >= 10) { // Enforced timeout of 10s - throw new Exception(Exception::RUNTIME_TIMEOUT); + throw new ExecutorException(ExecutorException::RUNTIME_TIMEOUT); } $runtime = $this->runtimes->get($runtimeName); @@ -81,7 +81,7 @@ public function getLogs(string $runtimeId, int $timeout, Response $response): vo $checkStart = \microtime(true); while (true) { if (\microtime(true) - $checkStart >= $timeout) { - throw new Exception(Exception::LOGS_TIMEOUT); + throw new ExecutorException(ExecutorException::LOGS_TIMEOUT); } if (\file_exists($tmpLogging . '/logs.txt') && \file_exists($tmpLogging . '/timings.txt')) { @@ -187,7 +187,7 @@ public function executeCommand(string $runtimeId, string $command, int $timeout) $runtimeName = System::getHostname() . '-' . $runtimeId; if (!$this->runtimes->exists($runtimeName)) { - throw new Exception(Exception::RUNTIME_NOT_FOUND); + throw new ExecutorException(ExecutorException::RUNTIME_NOT_FOUND); } $commands = [ @@ -202,9 +202,9 @@ public function executeCommand(string $runtimeId, string $command, int $timeout) $this->orchestration->execute($runtimeName, $commands, $output, [], $timeout); return $output; } catch (TimeoutException $e) { - throw new Exception(Exception::COMMAND_TIMEOUT, previous: $e); + throw new ExecutorException(ExecutorException::COMMAND_TIMEOUT, previous: $e); } catch (OrchestrationException $e) { - throw new Exception(Exception::COMMAND_FAILED, previous: $e); + throw new ExecutorException(ExecutorException::COMMAND_FAILED, previous: $e); } } @@ -235,10 +235,10 @@ public function createRuntime( if ($this->runtimes->exists($runtimeName)) { $existingRuntime = $this->runtimes->get($runtimeName); if ($existingRuntime instanceof \OpenRuntimes\Executor\Runner\Runtime && $existingRuntime->status === 'pending') { - throw new Exception(Exception::RUNTIME_CONFLICT, 'A runtime with the same ID is already being created. Attempt a execution soon.'); + throw new ExecutorException(ExecutorException::RUNTIME_CONFLICT, 'A runtime with the same ID is already being created. Attempt a execution soon.'); } - throw new Exception(Exception::RUNTIME_CONFLICT); + throw new ExecutorException(ExecutorException::RUNTIME_CONFLICT); } /** @var array $container */ @@ -372,7 +372,7 @@ public function createRuntime( ); if (!$status) { - throw new Exception(Exception::RUNTIME_FAILED, 'Failed to create runtime: ' . $stdout); + throw new ExecutorException(ExecutorException::RUNTIME_FAILED, 'Failed to create runtime: ' . $stdout); } if ($version === 'v2') { @@ -385,7 +385,7 @@ public function createRuntime( $output = Logs::get($runtimeName); } } catch (Throwable $err) { - throw new Exception(Exception::RUNTIME_FAILED, $err->getMessage(), null, $err); + throw new ExecutorException(ExecutorException::RUNTIME_FAILED, $err->getMessage(), null, $err); } } @@ -497,10 +497,8 @@ public function createRuntime( } // Remove weird symbol characters (for example from Next.js) - if (\is_array($container['output'])) { - foreach ($container['output'] as &$chunk) { - $chunk['content'] = \mb_convert_encoding($chunk['content'] ?? '', 'UTF-8', 'UTF-8'); - } + foreach ($container['output'] as &$chunk) { + $chunk['content'] = \mb_convert_encoding($chunk['content'] ?? '', 'UTF-8', 'UTF-8'); } return $container; @@ -511,7 +509,7 @@ public function deleteRuntime(string $runtimeId): void $runtimeName = System::getHostname() . '-' . $runtimeId; if (!$this->runtimes->exists($runtimeName)) { - throw new Exception(Exception::RUNTIME_NOT_FOUND); + throw new ExecutorException(ExecutorException::RUNTIME_NOT_FOUND); } $this->orchestration->remove($runtimeName, true); @@ -519,7 +517,7 @@ public function deleteRuntime(string $runtimeId): void } /** - * @throws Exception + * @throws ExecutorException */ public function createExecution( string $runtimeId, @@ -551,7 +549,7 @@ public function createExecution( // Prepare runtime if (!$this->runtimes->exists($runtimeName)) { if ($image === '' || $image === '0' || ($source === '' || $source === '0')) { - throw new Exception(Exception::RUNTIME_NOT_FOUND, 'Runtime not found. Please start it first or provide runtime-related parameters.'); + throw new ExecutorException(ExecutorException::RUNTIME_NOT_FOUND, 'Runtime not found. Please start it first or provide runtime-related parameters.'); } // Prepare request to executor @@ -605,7 +603,7 @@ public function createExecution( while (true) { // If timeout is passed, stop and return error if (\microtime(true) - $prepareStart >= $timeout) { - throw new Exception(Exception::RUNTIME_TIMEOUT); + throw new ExecutorException(ExecutorException::RUNTIME_TIMEOUT); } ['errNo' => $errNo, 'error' => $error, 'statusCode' => $statusCode, 'executorResponse' => $executorResponse] = \call_user_func($sendCreateRuntimeRequest); @@ -648,12 +646,12 @@ public function createExecution( while (true) { // If timeout is passed, stop and return error if (\microtime(true) - $launchStart >= $timeout) { - throw new Exception(Exception::RUNTIME_TIMEOUT); + throw new ExecutorException(ExecutorException::RUNTIME_TIMEOUT); } $runtimeStatus = $this->runtimes->get($runtimeName); if (!$runtimeStatus instanceof \OpenRuntimes\Executor\Runner\Runtime) { - throw new Exception(Exception::RUNTIME_NOT_FOUND, 'Runtime no longer exists.'); + throw new ExecutorException(ExecutorException::RUNTIME_NOT_FOUND, 'Runtime no longer exists.'); } if ($runtimeStatus->status !== 'pending') { @@ -669,7 +667,7 @@ public function createExecution( // Ensure we have secret $runtime = $this->runtimes->get($runtimeName); if (!$runtime instanceof \OpenRuntimes\Executor\Runner\Runtime) { - throw new Exception(Exception::RUNTIME_NOT_FOUND, 'Runtime secret not found. Please re-create the runtime.', 500); + throw new ExecutorException(ExecutorException::RUNTIME_NOT_FOUND, 'Runtime secret not found. Please re-create the runtime.', 500); } $hostname = $runtime->hostname; @@ -907,7 +905,7 @@ public function createExecution( while (true) { // If timeout is passed, stop and return error if (\microtime(true) - $pingStart >= $timeout) { - throw new Exception(Exception::RUNTIME_TIMEOUT); + throw new ExecutorException(ExecutorException::RUNTIME_TIMEOUT); } $online = $validator->isValid($hostname . ':' . 3000); @@ -957,7 +955,7 @@ public function createExecution( if ($executionResponse['errNo'] !== CURLE_OK) { // Intended timeout error for v2 functions if ($version === 'v2' && $executionResponse['errNo'] === SOCKET_ETIMEDOUT) { - throw new Exception(Exception::EXECUTION_TIMEOUT, $executionResponse['error'], 400); + throw new ExecutorException(ExecutorException::EXECUTION_TIMEOUT, $executionResponse['error'], 400); } throw new \Exception('Internal curl error has occurred within the executor! Error Number: ' . $executionResponse['errNo'], 500); @@ -1043,7 +1041,7 @@ public function getRuntime(string $name): mixed { $runtime = $this->runtimes->get($name); if (!$runtime instanceof \OpenRuntimes\Executor\Runner\Runtime) { - throw new Exception(Exception::RUNTIME_NOT_FOUND); + throw new ExecutorException(ExecutorException::RUNTIME_NOT_FOUND); } return $runtime->toArray();