Skip to content

Commit

Permalink
III-2490 Rename trimLeftToRight and trimRightToLeft to trimLeft and t…
Browse files Browse the repository at this point in the history
…rimRight.
  • Loading branch information
Luc Wollants committed Mar 6, 2018
1 parent d6a534b commit 3e88125
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/String/Behaviour/Trims.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ private function trim($value, $characters = " \t\n\r\0\x0B")
return trim($value, $characters);
}

private function trimLeftToRight($value, $characters = " \t\n\r\0\x0B")
private function trimLeft($value, $characters = " \t\n\r\0\x0B")
{
/* @var IsString $this */
$this->guardString($value);
return ltrim($value, $characters);
}

private function trimRightToLeft($value, $characters = " \t\n\r\0\x0B")
private function trimRight($value, $characters = " \t\n\r\0\x0B")
{
/* @var IsString $this */
$this->guardString($value);
Expand Down
4 changes: 2 additions & 2 deletions tests/String/Behaviour/IsTrimmedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function trimDataProvider()
*/
public function it_should_trim_left_to_right($original, $expected)
{
$trimmed = new MockTrimmedLeftToRight($original);
$trimmed = new MockTrimmedLeft($original);
$this->assertEquals($expected, $trimmed->toString());
}

Expand Down Expand Up @@ -97,7 +97,7 @@ public function trimLeftToRightDataProvider()
*/
public function it_should_trim_right_to_left($original, $expected)
{
$trimmed = new MockTrimmedRightToLeft($original);
$trimmed = new MockTrimmedRight($original);
$this->assertEquals($expected, $trimmed->toString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace TwoDotsTwice\ValueObject\String\Behaviour;

class MockTrimmedLeftToRight
class MockTrimmedLeft
{
use IsString;
use Trims;

public function __construct($value)
{
$value = $this->trimLeftToRight($value);
$value = $this->trimLeft($value);
$this->setValue($value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace TwoDotsTwice\ValueObject\String\Behaviour;

class MockTrimmedRightToLeft
class MockTrimmedRight
{
use IsString;
use Trims;

public function __construct($value)
{
$value = $this->trimRightToLeft($value);
$value = $this->trimRight($value);
$this->setValue($value);
}
}

0 comments on commit 3e88125

Please sign in to comment.