@@ -26,8 +26,7 @@ |
||
26 | 26 | * |
27 | 27 | * @throws ExceptionInterface |
28 | 28 | */ |
29 | -abstract class AbstractUnicodeString extends AbstractString |
|
30 | -{ |
|
29 | +abstract class AbstractUnicodeString extends AbstractString { |
|
31 | 30 | public const NFC = \Normalizer::NFC; |
32 | 31 | public const NFD = \Normalizer::NFD; |
33 | 32 | public const NFKC = \Normalizer::NFKC; |
@@ -30,10 +30,8 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @throws ExceptionInterface |
32 | 32 | */ |
33 | -class UnicodeString extends AbstractUnicodeString |
|
34 | -{ |
|
35 | - public function __construct(string $string = '') |
|
36 | - { |
|
33 | +class UnicodeString extends AbstractUnicodeString { |
|
34 | + public function __construct(string $string = '') { |
|
37 | 35 | $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); |
38 | 36 | |
39 | 37 | if (false === $this->string) { |
@@ -357,8 +355,7 @@ discard block |
||
357 | 355 | return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); |
358 | 356 | } |
359 | 357 | |
360 | - public function __wakeup() |
|
361 | - { |
|
358 | + public function __wakeup() { |
|
362 | 359 | if (!\is_string($this->string)) { |
363 | 360 | throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); |
364 | 361 | } |
@@ -366,8 +363,7 @@ discard block |
||
366 | 363 | normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); |
367 | 364 | } |
368 | 365 | |
369 | - public function __clone() |
|
370 | - { |
|
366 | + public function __clone() { |
|
371 | 367 | if (null === $this->ignoreCase) { |
372 | 368 | normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); |
373 | 369 | } |
@@ -93,8 +93,7 @@ discard block |
||
93 | 93 | /** |
94 | 94 | * @return string |
95 | 95 | */ |
96 | - public function __toString() |
|
97 | - { |
|
96 | + public function __toString() { |
|
98 | 97 | if (\is_string($this->value)) { |
99 | 98 | return $this->value; |
100 | 99 | } |
@@ -132,8 +131,7 @@ discard block |
||
132 | 131 | return $this->__toString(); |
133 | 132 | } |
134 | 133 | |
135 | - private function __construct() |
|
136 | - { |
|
134 | + private function __construct() { |
|
137 | 135 | } |
138 | 136 | |
139 | 137 | private static function getPrettyName(callable $callback): string |
@@ -715,8 +715,7 @@ |
||
715 | 715 | return ['string']; |
716 | 716 | } |
717 | 717 | |
718 | - public function __clone() |
|
719 | - { |
|
718 | + public function __clone() { |
|
720 | 719 | $this->ignoreCase = false; |
721 | 720 | } |
722 | 721 |
@@ -22,10 +22,8 @@ |
||
22 | 22 | * |
23 | 23 | * @throws ExceptionInterface |
24 | 24 | */ |
25 | -class CodePointString extends AbstractUnicodeString |
|
26 | -{ |
|
27 | - public function __construct(string $string = '') |
|
28 | - { |
|
25 | +class CodePointString extends AbstractUnicodeString { |
|
26 | + public function __construct(string $string = '') { |
|
29 | 27 | if ('' !== $string && !preg_match('//u', $string)) { |
30 | 28 | throw new InvalidArgumentException('Invalid UTF-8 string.'); |
31 | 29 | } |
@@ -18,8 +18,7 @@ |
||
18 | 18 | * |
19 | 19 | * @author Titouan Galopin <[email protected]> |
20 | 20 | */ |
21 | -interface SluggerInterface |
|
22 | -{ |
|
21 | +interface SluggerInterface { |
|
23 | 22 | /** |
24 | 23 | * Creates a slug for the given string and locale, using appropriate transliteration when needed. |
25 | 24 | */ |
@@ -69,8 +69,7 @@ discard block |
||
69 | 69 | /** |
70 | 70 | * @param array|\Closure|null $symbolsMap |
71 | 71 | */ |
72 | - public function __construct(string $defaultLocale = null, $symbolsMap = null) |
|
73 | - { |
|
72 | + public function __construct(string $defaultLocale = null, $symbolsMap = null) { |
|
74 | 73 | if (null !== $symbolsMap && !\is_array($symbolsMap) && !$symbolsMap instanceof \Closure) { |
75 | 74 | throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be array, Closure or null, "%s" given.', __METHOD__, \gettype($symbolsMap))); |
76 | 75 | } |
@@ -82,16 +81,14 @@ discard block |
||
82 | 81 | /** |
83 | 82 | * {@inheritdoc} |
84 | 83 | */ |
85 | - public function setLocale($locale) |
|
86 | - { |
|
84 | + public function setLocale($locale) { |
|
87 | 85 | $this->defaultLocale = $locale; |
88 | 86 | } |
89 | 87 | |
90 | 88 | /** |
91 | 89 | * {@inheritdoc} |
92 | 90 | */ |
93 | - public function getLocale() |
|
94 | - { |
|
91 | + public function getLocale() { |
|
95 | 92 | return $this->defaultLocale; |
96 | 93 | } |
97 | 94 |
@@ -23,12 +23,10 @@ |
||
23 | 23 | * |
24 | 24 | * @throws ExceptionInterface |
25 | 25 | */ |
26 | -class ByteString extends AbstractString |
|
27 | -{ |
|
26 | +class ByteString extends AbstractString { |
|
28 | 27 | private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; |
29 | 28 | |
30 | - public function __construct(string $string = '') |
|
31 | - { |
|
29 | + public function __construct(string $string = '') { |
|
32 | 30 | $this->string = $string; |
33 | 31 | } |
34 | 32 |
@@ -16,8 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". |
18 | 18 | */ |
19 | -final class FrenchInflector implements InflectorInterface |
|
20 | -{ |
|
19 | +final class FrenchInflector implements InflectorInterface { |
|
21 | 20 | /** |
22 | 21 | * A list of all rules for pluralise. |
23 | 22 | * |