Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Add String::squish() helper #41791

Merged
merged 6 commits into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make more consistent
  • Loading branch information
dwightwatson committed Apr 2, 2022
commit 05133823f7eb81581243b3e143fef7101a7fd6bb
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ public static function snake($value, $delimiter = '_')
}

/**
* Squish all blank space in a string.
* Squish all blank space from the given string.
*
* @param string $value
* @return string
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/SupportStringableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public function testSlug()

public function testSquish()
{
$this->assertSame('words with spaces', (string) $this->stringable(' words with spaces ')->squish());
$this->assertSame('words with spaces', (string) $this->stringable(' words with spaces ')->squish());
$this->assertSame('words with spaces', (string) $this->stringable("words\t\twith\n\nspaces")->squish());
$this->assertSame('words with spaces', (string) $this->stringable('
words
Expand Down