From d45c612bfd2243787436f45caeb47fc713577339 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 20:59:10 +0000 Subject: [PATCH 1/2] Initial plan From ee2b9be34c1a61b4cf556aa847f2e723a597dd59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 21:07:45 +0000 Subject: [PATCH 2/2] fix: add proper return types to interface methods, remove #[ReturnTypeWillChange] attributes Agent-Logs-Url: https://github.com/voku/Stringy/sessions/21daae3c-674b-4017-a3fa-56be4ba82c53 Co-authored-by: voku <264695+voku@users.noreply.github.com> --- src/Stringy.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Stringy.php b/src/Stringy.php index e3c98aa..f7b600b 100644 --- a/src/Stringy.php +++ b/src/Stringy.php @@ -2509,14 +2509,11 @@ public function isWhitespace(): bool * EXAMPLE: * * - * @noinspection ReturnTypeCanBeDeclaredInspection - * * @psalm-mutation-free * * @return string The current value of the $str property */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): mixed { return (string) $this; } @@ -3113,8 +3110,7 @@ public function offsetGet($offset): string * * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { // Stringy is immutable, cannot directly set char throw new \Exception('Stringy object is immutable, cannot modify char'); @@ -3134,8 +3130,7 @@ public function offsetSet($offset, $value) * * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { // Don't allow directly modifying the string throw new \Exception('Stringy object is immutable, cannot unset char');