From 7273a72af83a7474c7615db55d0f228462c8e1cf Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 13 Apr 2021 18:24:11 +0300 Subject: [PATCH] Strings 3.0.2 --- CHANGELOG.md | 4 ++++ src/Strings.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6c91d6..bb40d90 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ + +# [3.0.2](https://github.com/atomastic/strings) (2021-04-13) +* fix snake() method + # [3.0.1](https://github.com/atomastic/strings) (2021-02-19) * fix dependencies. diff --git a/src/Strings.php b/src/Strings.php index b5a267e..7593a61 100644 --- a/src/Strings.php +++ b/src/Strings.php @@ -402,10 +402,10 @@ public function snake(string $delimiter = '_'): self if (! ctype_lower($this->string)) { $string = preg_replace('/\s+/u', '', ucwords($this->string)); $string = static::create(preg_replace('/(.)(?=[A-Z])/u', '$1' . $delimiter, $string), $this->encoding)->lower(); + + $this->string = $string->toString(); } - $this->string = $string->toString(); - return $this; }