Skip to content

Commit

Permalink
Scrutinizer Auto-Fixes
Browse files Browse the repository at this point in the history
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
  • Loading branch information
scrutinizer-auto-fixer committed Nov 11, 2015
1 parent e665132 commit 32e44fe
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Stringy.php
Expand Up @@ -61,7 +61,7 @@ public function __construct($str = '', $encoding = null)

// init
UTF8::checkForSupport();
$this->str = (string)$str;
$this->str = (string) $str;

if ($encoding) {
$this->encoding = $encoding;
Expand Down Expand Up @@ -157,7 +157,7 @@ public function between($start, $end, $offset = 0)
*/
public function indexOf($needle, $offset = 0)
{
return UTF8::strpos($this->str, (string)$needle, (int)$offset, $this->encoding);
return UTF8::strpos($this->str, (string) $needle, (int) $offset, $this->encoding);
}

/**
Expand Down Expand Up @@ -429,7 +429,7 @@ public function startsWith($substring, $caseSensitive = true)
$startOfStr = UTF8::strtolower($startOfStr, $this->encoding);
}

return (string)$substring === $startOfStr;
return (string) $substring === $startOfStr;
}

/**
Expand Down Expand Up @@ -478,7 +478,7 @@ public function endsWith($substring, $caseSensitive = true)
$endOfStr = UTF8::strtolower($endOfStr, $this->encoding);
}

return (string)$substring === $endOfStr;
return (string) $substring === $endOfStr;
}

/**
Expand Down Expand Up @@ -666,7 +666,7 @@ public function upperCaseFirst()
*/
public function indexOfLast($needle, $offset = 0)
{
return UTF8::strrpos($this->str, (string)$needle, (int)$offset, $this->encoding);
return UTF8::strrpos($this->str, (string) $needle, (int) $offset, $this->encoding);
}

/**
Expand Down Expand Up @@ -965,7 +965,7 @@ public function offsetExists($offset)
{
// init
$length = $this->length();
$offset = (int)$offset;
$offset = (int) $offset;

if ($offset >= 0) {
return ($length > $offset);
Expand All @@ -982,7 +982,7 @@ public function offsetExists($offset)
*
* @param mixed $offset The index from which to retrieve the char
*
* @return mixed The character at the specified index
* @return string The character at the specified index
* @throws \OutOfBoundsException If the positive or negative offset does
* not exist
*/
Expand Down Expand Up @@ -1494,7 +1494,7 @@ public function swapCase()

$stringy->str = preg_replace_callback(
'/[\S]/u',
function ($match) use ($encoding) {
function($match) use ($encoding) {
$marchToUpper = UTF8::strtoupper($match[0], $encoding);

if ($match[0] == $marchToUpper) {
Expand Down Expand Up @@ -1539,13 +1539,13 @@ public function titleize($ignore = null)

$stringy->str = preg_replace_callback(
'/([\S]+)/u',
function ($match) use ($encoding, $ignore) {
function($match) use ($encoding, $ignore) {
if ($ignore && in_array($match[0], $ignore, true)) {
return $match[0];
} else {
$stringy = new Stringy($match[0], $encoding);

return (string)$stringy->toLowerCase()->upperCaseFirst();
return (string) $stringy->toLowerCase()->upperCaseFirst();
}
},
$stringy->str
Expand Down Expand Up @@ -1627,9 +1627,9 @@ public function toBoolean()
if (array_key_exists($key, $map)) {
return $map[$key];
} elseif (is_numeric($this->str)) {
return ((int)$this->str > 0);
return ((int) $this->str > 0);
} else {
return (bool)$this->regexReplace('[[:space:]]', '')->str;
return (bool) $this->regexReplace('[[:space:]]', '')->str;
}
}

Expand Down Expand Up @@ -1799,7 +1799,7 @@ public function camelize()

$stringy->str = preg_replace_callback(
'/[-_\s]+(.)?/u',
function ($match) use ($encoding) {
function($match) use ($encoding) {
if (isset($match[1])) {
return UTF8::strtoupper($match[1], $encoding);
} else {
Expand All @@ -1811,7 +1811,7 @@ function ($match) use ($encoding) {

$stringy->str = preg_replace_callback(
'/[\d]+(.)?/u',
function ($match) use ($encoding) {
function($match) use ($encoding) {
return UTF8::strtoupper($match[0], $encoding);
},
$stringy->str
Expand Down

0 comments on commit 32e44fe

Please sign in to comment.