@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | // init |
62 | 62 | UTF8::checkForSupport(); |
63 | - $this->str = (string)$str; |
|
63 | + $this->str = (string) $str; |
|
64 | 64 | |
65 | 65 | if ($encoding) { |
66 | 66 | $this->encoding = $encoding; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function indexOf($needle, $offset = 0) |
158 | 158 | { |
159 | - return UTF8::strpos($this->str, (string)$needle, (int)$offset, $this->encoding); |
|
159 | + return UTF8::strpos($this->str, (string) $needle, (int) $offset, $this->encoding); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $startOfStr = UTF8::strtolower($startOfStr, $this->encoding); |
429 | 429 | } |
430 | 430 | |
431 | - return (string)$substring === $startOfStr; |
|
431 | + return (string) $substring === $startOfStr; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $endOfStr = UTF8::strtolower($endOfStr, $this->encoding); |
478 | 478 | } |
479 | 479 | |
480 | - return (string)$substring === $endOfStr; |
|
480 | + return (string) $substring === $endOfStr; |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | /** |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public function indexOfLast($needle, $offset = 0) |
667 | 667 | { |
668 | - return UTF8::strrpos($this->str, (string)$needle, (int)$offset, $this->encoding); |
|
668 | + return UTF8::strrpos($this->str, (string) $needle, (int) $offset, $this->encoding); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | /** |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | { |
966 | 966 | // init |
967 | 967 | $length = $this->length(); |
968 | - $offset = (int)$offset; |
|
968 | + $offset = (int) $offset; |
|
969 | 969 | |
970 | 970 | if ($offset >= 0) { |
971 | 971 | return ($length > $offset); |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | public function offsetGet($offset) |
990 | 990 | { |
991 | 991 | // init |
992 | - $offset = (int)$offset; |
|
992 | + $offset = (int) $offset; |
|
993 | 993 | $length = $this->length(); |
994 | 994 | |
995 | 995 | if ( |
@@ -1568,13 +1568,13 @@ discard block |
||
1568 | 1568 | |
1569 | 1569 | $stringy->str = preg_replace_callback( |
1570 | 1570 | '/([\S]+)/u', |
1571 | - function ($match) use ($encoding, $ignore) { |
|
1571 | + function($match) use ($encoding, $ignore) { |
|
1572 | 1572 | if ($ignore && in_array($match[0], $ignore, true)) { |
1573 | 1573 | return $match[0]; |
1574 | 1574 | } else { |
1575 | 1575 | $stringy = new Stringy($match[0], $encoding); |
1576 | 1576 | |
1577 | - return (string)$stringy->toLowerCase()->upperCaseFirst(); |
|
1577 | + return (string) $stringy->toLowerCase()->upperCaseFirst(); |
|
1578 | 1578 | } |
1579 | 1579 | }, |
1580 | 1580 | $stringy->str |
@@ -1648,9 +1648,9 @@ discard block |
||
1648 | 1648 | if (array_key_exists($key, $map)) { |
1649 | 1649 | return $map[$key]; |
1650 | 1650 | } elseif (is_numeric($this->str)) { |
1651 | - return ((int)$this->str > 0); |
|
1651 | + return ((int) $this->str > 0); |
|
1652 | 1652 | } else { |
1653 | - return (bool)$this->regexReplace('[[:space:]]', '')->str; |
|
1653 | + return (bool) $this->regexReplace('[[:space:]]', '')->str; |
|
1654 | 1654 | } |
1655 | 1655 | } |
1656 | 1656 | |
@@ -1661,7 +1661,7 @@ discard block |
||
1661 | 1661 | */ |
1662 | 1662 | public function toString() |
1663 | 1663 | { |
1664 | - return (string)$this->str; |
|
1664 | + return (string) $this->str; |
|
1665 | 1665 | } |
1666 | 1666 | |
1667 | 1667 | /** |
@@ -1830,7 +1830,7 @@ discard block |
||
1830 | 1830 | |
1831 | 1831 | $stringy->str = preg_replace_callback( |
1832 | 1832 | '/[-_\s]+(.)?/u', |
1833 | - function ($match) use ($encoding) { |
|
1833 | + function($match) use ($encoding) { |
|
1834 | 1834 | if (isset($match[1])) { |
1835 | 1835 | return UTF8::strtoupper($match[1], $encoding); |
1836 | 1836 | } else { |
@@ -1842,7 +1842,7 @@ discard block |
||
1842 | 1842 | |
1843 | 1843 | $stringy->str = preg_replace_callback( |
1844 | 1844 | '/[\d]+(.)?/u', |
1845 | - function ($match) use ($encoding) { |
|
1845 | + function($match) use ($encoding) { |
|
1846 | 1846 | return UTF8::strtoupper($match[0], $encoding); |
1847 | 1847 | }, |
1848 | 1848 | $stringy->str |
@@ -1865,9 +1865,9 @@ discard block |
||
1865 | 1865 | |
1866 | 1866 | $str = preg_replace_callback( |
1867 | 1867 | '/([\d|A-Z])/u', |
1868 | - function ($matches) { |
|
1868 | + function($matches) { |
|
1869 | 1869 | $match = $matches[1]; |
1870 | - $matchInt = (int)$match; |
|
1870 | + $matchInt = (int) $match; |
|
1871 | 1871 | |
1872 | 1872 | if ("$matchInt" == $match) { |
1873 | 1873 | return '_' . $match . '_'; |
@@ -1881,9 +1881,9 @@ discard block |
||
1881 | 1881 | $str = preg_replace( |
1882 | 1882 | array( |
1883 | 1883 | |
1884 | - '/\s+/', // convert spaces to "_" |
|
1885 | - '/^\s+|\s+$/', // trim leading & trailing spaces |
|
1886 | - '/_+/', // remove double "_" |
|
1884 | + '/\s+/', // convert spaces to "_" |
|
1885 | + '/^\s+|\s+$/', // trim leading & trailing spaces |
|
1886 | + '/_+/', // remove double "_" |
|
1887 | 1887 | ), |
1888 | 1888 | array( |
1889 | 1889 | '_', |