Skip to content

Commit

Permalink
Updated php-cs-fixer config and ran it
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Mar 20, 2020
1 parent efcf2af commit 89fa0b7
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 92 deletions.
3 changes: 0 additions & 3 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ return PhpCsFixer\Config::create()
'ordered_imports' => true,
'phpdoc_no_empty_return' => false,
'phpdoc_order' => true,
'return_type_declaration' => [
'space_before' => 'one'
],
'semicolon_after_instruction' => true,
'single_trait_insert_per_statement' => false,
'trailing_comma_in_multiline_array' => false,
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function setEncoding(string $encoding)
*
* @return string
*/
public static function getEncoding() : string
public static function getEncoding(): string
{
return self::$encoding;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct($string = '', $encoding = null)
*
* @return string The string
*/
public function __toString() : string
public function __toString(): string
{
return $this->string;
}
Expand All @@ -55,7 +55,7 @@ public function __toString() : string
*
* @return self
*/
public static function make(...$parameters) : self
public static function make(...$parameters): self
{
return new static(...$parameters);
}
Expand All @@ -65,7 +65,7 @@ public static function make(...$parameters) : self
*
* @return string
*/
public function jsonSerialize() : string
public function jsonSerialize(): string
{
return $this->string;
}
Expand All @@ -75,7 +75,7 @@ public function jsonSerialize() : string
*
* @return string
*/
public function serialize() : string
public function serialize(): string
{
return serialize($this->string);
}
Expand All @@ -97,7 +97,7 @@ public function unserialize($serialized)
*
* @return self
*/
public function encoding(string $encoding) : self
public function encoding(string $encoding): self
{
return new static($this->string, $encoding);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Str
*
* @return array
*/
public static function characters(string $string) : array
public static function characters(string $string): array
{
return preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY);
}
Expand All @@ -23,7 +23,7 @@ public static function characters(string $string) : array
*
* @return array
*/
public static function words(string $string) : array
public static function words(string $string): array
{
preg_match_all('/\p{Lu}?[\p{Ll}0-9]+/u', $string, $matches);

Expand Down
36 changes: 18 additions & 18 deletions src/Traits/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait Aliases
*
* @return self
*/
public function first(int $count) : self
public function first(int $count): self
{
return $this->substring(0, $count);
}
Expand All @@ -25,7 +25,7 @@ public function first(int $count) : self
*
* @return self
*/
public function last(int $count) : self
public function last(int $count): self
{
return $this->substring(-$count);
}
Expand All @@ -35,7 +35,7 @@ public function last(int $count) : self
*
* @return self
*/
public function base64Encode() : self
public function base64Encode(): self
{
return $this->base64(Config\Base64::ENCODE);
}
Expand All @@ -45,7 +45,7 @@ public function base64Encode() : self
*
* @return self
*/
public function base64Decode() : self
public function base64Decode(): self
{
return $this->base64(Config\Base64::DECODE);
}
Expand All @@ -55,7 +55,7 @@ public function base64Decode() : self
*
* @return self
*/
public function hexEncode() : self
public function hexEncode(): self
{
return $this->hex(Config\Hex::ENCODE);
}
Expand All @@ -65,7 +65,7 @@ public function hexEncode() : self
*
* @return self
*/
public function hexDecode() : self
public function hexDecode(): self
{
return $this->hex(Config\Hex::DECODE);
}
Expand All @@ -78,7 +78,7 @@ public function hexDecode() : self
*
* @return self
*/
public function trimLeft(string $mask = " \t\n\r\0\x0B") : self
public function trimLeft(string $mask = " \t\n\r\0\x0B"): self
{
return $this->trim($mask, Config\Trim::LEFT);
}
Expand All @@ -90,7 +90,7 @@ public function trimLeft(string $mask = " \t\n\r\0\x0B") : self
*
* @return self
*/
public function trimRight(string $mask = " \t\n\r\0\x0B") : self
public function trimRight(string $mask = " \t\n\r\0\x0B"): self
{
return $this->trim($mask, Config\Trim::RIGHT);
}
Expand All @@ -100,7 +100,7 @@ public function trimRight(string $mask = " \t\n\r\0\x0B") : self
*
* @return self
*/
public function uppercaseFirst() : self
public function uppercaseFirst(): self
{
return $this->uppercase(Config\Uppercase::FIRST);
}
Expand All @@ -110,7 +110,7 @@ public function uppercaseFirst() : self
*
* @return self
*/
public function uppercaseWords() : self
public function uppercaseWords(): self
{
return $this->uppercase(Config\Uppercase::WORDS);
}
Expand All @@ -120,7 +120,7 @@ public function uppercaseWords() : self
*
* @return self
*/
public function lowercaseFirst() : self
public function lowercaseFirst(): self
{
return $this->lowercase(Config\Lowercase::FIRST);
}
Expand All @@ -130,7 +130,7 @@ public function lowercaseFirst() : self
*
* @return self
*/
public function lowercaseWords() : self
public function lowercaseWords(): self
{
return $this->lowercase(Config\Lowercase::WORDS);
}
Expand All @@ -144,7 +144,7 @@ public function lowercaseWords() : self
*
* @return self
*/
public function wrapSoft(int $width, string $break = "\n") : self
public function wrapSoft(int $width, string $break = "\n"): self
{
return $this->wrap($width, $break, Config\Wrap::SOFT);
}
Expand All @@ -157,7 +157,7 @@ public function wrapSoft(int $width, string $break = "\n") : self
*
* @return self
*/
public function wrapHard($width, $break = "\n") : self
public function wrapHard($width, $break = "\n"): self
{
return $this->wrap($width, $break, Config\Wrap::HARD);
}
Expand All @@ -170,7 +170,7 @@ public function wrapHard($width, $break = "\n") : self
*
* @return self
*/
public function padRight(int $length, string $padding = ' ') : self
public function padRight(int $length, string $padding = ' '): self
{
return $this->pad($length, $padding, Config\Pad::RIGHT);
}
Expand All @@ -183,7 +183,7 @@ public function padRight(int $length, string $padding = ' ') : self
*
* @return self
*/
public function padLeft(int $length, string $padding = ' ') : self
public function padLeft(int $length, string $padding = ' '): self
{
return $this->pad($length, $padding, Config\Pad::LEFT);
}
Expand All @@ -196,7 +196,7 @@ public function padLeft(int $length, string $padding = ' ') : self
*
* @return self
*/
public function padBoth(int $length, string $padding = ' ') : self
public function padBoth(int $length, string $padding = ' '): self
{
return $this->pad($length, $padding, Config\Pad::BOTH);
}
Expand All @@ -208,7 +208,7 @@ public function padBoth(int $length, string $padding = ' ') : self
*
* @return bool
*/
public function insensitiveMatch(string $string) : bool
public function insensitiveMatch(string $string): bool
{
return $this->equals($string, Config\Equals::CASE_INSENSITIVE);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/ArrayAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait ArrayAccess
*
* @return bool
*/
public function offsetExists($offset) : bool
public function offsetExists($offset): bool
{
return isset($this->string[$offset]);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Traits/Caseable.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait Caseable
*
* @return self
*/
public function uppercase(string $mode = Config\Uppercase::ALL) : self
public function uppercase(string $mode = Config\Uppercase::ALL): self
{
Config\Uppercase::validateOption($mode);

Expand Down Expand Up @@ -66,7 +66,7 @@ public function uppercase(string $mode = Config\Uppercase::ALL) : self
*
* @return self
*/
public function lowercase(string $mode = Config\Lowercase::ALL) : self
public function lowercase(string $mode = Config\Lowercase::ALL): self
{
Config\Lowercase::validateOption($mode);

Expand Down Expand Up @@ -97,7 +97,7 @@ public function lowercase(string $mode = Config\Lowercase::ALL) : self
*
* @return self
*/
public function camelCase() : self
public function camelCase(): self
{
$words = array_map(function ($word) {
return mb_strtoupper(mb_substr($word, 0, 1, $this->encoding), $this->encoding) . mb_substr($word, 1, null, $this->encoding);
Expand All @@ -116,7 +116,7 @@ public function camelCase() : self
*
* @return self
*/
public function studlyCase() : self
public function studlyCase(): self
{
$words = array_map(function ($word) {
return mb_strtoupper(mb_substr($word, 0, 1, $this->encoding), $this->encoding) . mb_substr($word, 1, null, $this->encoding);
Expand All @@ -130,7 +130,7 @@ public function studlyCase() : self
*
* @return self
*/
public function pascalCase() : self
public function pascalCase(): self
{
return $this->studlyCase();
}
Expand All @@ -140,7 +140,7 @@ public function pascalCase() : self
*
* @return self
*/
public function snakeCase() : self
public function snakeCase(): self
{
$words = array_map(function ($word) {
return mb_strtolower($word, $this->encoding);
Expand All @@ -154,7 +154,7 @@ public function snakeCase() : self
*
* @return self
*/
public function kebabCase() : self
public function kebabCase(): self
{
$words = array_map(function ($word) {
return mb_strtolower($word, $this->encoding);
Expand Down
14 changes: 7 additions & 7 deletions src/Traits/Comparable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait Comparable
*
* @return bool True if the string matches the comparing string
*/
public function equals(string $string, string $mode = Config\Equals::CASE_SENSITIVE) : bool
public function equals(string $string, string $mode = Config\Equals::CASE_SENSITIVE): bool
{
Config\Equals::validateOption($mode);

Expand All @@ -35,7 +35,7 @@ public function equals(string $string, string $mode = Config\Equals::CASE_SENSIT
*
* @return bool True if the string matches the regular expression pattern
*/
public function matches(string $pattern) : bool
public function matches(string $pattern): bool
{
return (bool) preg_match($pattern, $this->string);
}
Expand All @@ -47,7 +47,7 @@ public function matches(string $pattern) : bool
*
* @return bool True if the string starts with $string, otherwise false
*/
public function startsWith(string $string) : bool
public function startsWith(string $string): bool
{
if ($this->string === '' || $string === '') {
return false;
Expand All @@ -67,7 +67,7 @@ public function startsWith(string $string) : bool
*
* @return bool True if the string ends with $string, otherwise false
*/
public function endsWith(string $string) : bool
public function endsWith(string $string): bool
{
if ($this->string === '' || $string === '') {
return false;
Expand All @@ -83,7 +83,7 @@ public function endsWith(string $string) : bool
*
* @return bool True if the string contains $string, otherwise false
*/
public function contains(string $string) : bool
public function contains(string $string): bool
{
return mb_strpos($this->string, $string, 0, $this->encoding) !== false;
}
Expand All @@ -103,7 +103,7 @@ public function contains(string $string) : bool
*
* @return bool True if the string exists in $string, otherwise false
*/
public function in(string $string, string $mode = Config\In::CASE_SENSITIVE) : bool
public function in(string $string, string $mode = Config\In::CASE_SENSITIVE): bool
{
Config\In::validateOption($mode);

Expand All @@ -117,7 +117,7 @@ public function in(string $string, string $mode = Config\In::CASE_SENSITIVE) : b
*
* @return float
*/
public function similarity(string $string) : float
public function similarity(string $string): float
{
similar_text($this->string, $string, $percent);

Expand Down
Loading

0 comments on commit 89fa0b7

Please sign in to comment.