Skip to content

Commit 7273a72

Browse files
committed
Strings 3.0.2
1 parent 9bf67f9 commit 7273a72

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<a name="3.0.2"></a>
2+
# [3.0.2](https://github.com/atomastic/strings) (2021-04-13)
3+
* fix snake() method
4+
15
<a name="3.0.1"></a>
26
# [3.0.1](https://github.com/atomastic/strings) (2021-02-19)
37
* fix dependencies.

src/Strings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ public function snake(string $delimiter = '_'): self
402402
if (! ctype_lower($this->string)) {
403403
$string = preg_replace('/\s+/u', '', ucwords($this->string));
404404
$string = static::create(preg_replace('/(.)(?=[A-Z])/u', '$1' . $delimiter, $string), $this->encoding)->lower();
405+
406+
$this->string = $string->toString();
405407
}
406408

407-
$this->string = $string->toString();
408-
409409
return $this;
410410
}
411411

0 commit comments

Comments
 (0)