Skip to content

Commit

Permalink
Removed useless constants for character separators
Browse files Browse the repository at this point in the history
  • Loading branch information
drgomesp committed Nov 1, 2015
1 parent 9be5770 commit 31cde3c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
Binary file added composer.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion spec/Coduo/PHPHumanizer/StringSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function it_humanize_string()

function it_humanize_string_with_special_character()
{
$this->humanize('news-count', true, Humanize::SEPARATOR_DASH)->shouldReturn('News count');
$this->humanize('news-count', true, '-')->shouldReturn('News count');
}

function it_humanize_strings_without_capitalize()
Expand Down
2 changes: 1 addition & 1 deletion src/Coduo/PHPHumanizer/String.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class String
{
public static function humanize($text, $capitalize = true, $separator = Humanize::SEPARATOR_UNDERSCORE)
public static function humanize($text, $capitalize = true, $separator = '_')
{
return (string) new Humanize($text, $capitalize, $separator);
}
Expand Down
5 changes: 1 addition & 4 deletions src/Coduo/PHPHumanizer/String/Humanize.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

class Humanize
{
const SEPARATOR_DASH = '-';
const SEPARATOR_UNDERSCORE = '_';

/**
* @var array
*/
Expand All @@ -32,7 +29,7 @@ class Humanize
* @param bool $capitalize
* @param string $separator
*/
public function __construct($text, $capitalize = true, $separator = self::SEPARATOR_UNDERSCORE)
public function __construct($text, $capitalize = true, $separator = '_')
{
$this->text = $text;
$this->capitalize = $capitalize;
Expand Down

0 comments on commit 31cde3c

Please sign in to comment.