From 3486a5ab13bb66f0d0c454ca9aeb1422999768a0 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 25 May 2025 14:11:43 +0200 Subject: [PATCH 1/4] make sure we can convert Request and Notification to string This is already used when we are logging --- src/Message/Notification.php | 5 +++++ src/Message/Request.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Message/Notification.php b/src/Message/Notification.php index 02c9a0e..3eb3768 100644 --- a/src/Message/Notification.php +++ b/src/Message/Notification.php @@ -37,4 +37,9 @@ public function jsonSerialize(): array 'params' => $this->params, ]; } + + public function __toString(): string + { + return sprintf('%s', $this->method); + } } diff --git a/src/Message/Request.php b/src/Message/Request.php index fe92920..05a5f73 100644 --- a/src/Message/Request.php +++ b/src/Message/Request.php @@ -40,4 +40,9 @@ public function jsonSerialize(): array 'params' => $this->params, ]; } + + public function __toString(): string + { + return sprintf('%s: %s', $this->id, $this->method); + } } From 8cd664c2586679b735aa48fee34775eac7e651d3 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 25 May 2025 15:47:42 +0200 Subject: [PATCH 2/4] fix: minor --- .github/workflows/pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 68dd972..f33b180 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -38,6 +38,10 @@ jobs: qa: runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: - name: Checkout uses: actions/checkout@v4 From 4a7833c1cdadc71de4b5c1012dc3f23adcf8c6ac Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 25 May 2025 15:48:49 +0200 Subject: [PATCH 3/4] fix: revert minor --- .github/workflows/pipeline.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index f33b180..68dd972 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -38,10 +38,6 @@ jobs: qa: runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - name: Checkout uses: actions/checkout@v4 From eef72ddf7054add5691a08f142b5388e30b92ca0 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 25 May 2025 15:49:33 +0200 Subject: [PATCH 4/4] fix: rector --- src/Message/Notification.php | 2 +- src/Message/Request.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Message/Notification.php b/src/Message/Notification.php index 3eb3768..74f9c3d 100644 --- a/src/Message/Notification.php +++ b/src/Message/Notification.php @@ -4,7 +4,7 @@ namespace PhpLlm\McpSdk\Message; -final readonly class Notification implements \JsonSerializable +final readonly class Notification implements \JsonSerializable, \Stringable { /** * @param array|null $params diff --git a/src/Message/Request.php b/src/Message/Request.php index 05a5f73..97bd139 100644 --- a/src/Message/Request.php +++ b/src/Message/Request.php @@ -4,7 +4,7 @@ namespace PhpLlm\McpSdk\Message; -final class Request implements \JsonSerializable +final class Request implements \JsonSerializable, \Stringable { /** * @param array|null $params