@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return string The processed HTML |
82 | 82 | */ |
83 | - public function typogrify(string|int|float|null $text, bool $isTitle = false): string |
|
83 | + public function typogrify(string | int | float | null $text, bool $isTitle = false): string |
|
84 | 84 | { |
85 | 85 | if (empty($text)) { |
86 | 86 | return ''; |
87 | 87 | } |
88 | 88 | |
89 | - return $this->phpTypography->process((string)$text, $this->phpTypographySettings, $isTitle); |
|
89 | + return $this->phpTypography->process((string) $text, $this->phpTypographySettings, $isTitle); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @return string The processed HTML |
103 | 103 | */ |
104 | - public function typogrifyFeed(string|int|float|null $text, bool $isTitle = false): string |
|
104 | + public function typogrifyFeed(string | int | float | null $text, bool $isTitle = false): string |
|
105 | 105 | { |
106 | 106 | if (empty($text)) { |
107 | 107 | return ''; |
108 | 108 | } |
109 | 109 | |
110 | - return $this->phpTypography->process_feed((string)$text, $this->phpTypographySettings, $isTitle); |
|
110 | + return $this->phpTypography->process_feed((string) $text, $this->phpTypographySettings, $isTitle); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | * |
116 | 116 | * @return string |
117 | 117 | */ |
118 | - public function smartypants(string|int|float|null $text): string |
|
118 | + public function smartypants(string | int | float | null $text): string |
|
119 | 119 | { |
120 | 120 | if (empty($text)) { |
121 | 121 | return ''; |
122 | 122 | } |
123 | 123 | |
124 | - return SmartyPants::defaultTransform((string)$text); |
|
124 | + return SmartyPants::defaultTransform((string) $text); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return string with the resulting $str after truncating |
137 | 137 | */ |
138 | - public function truncate(string|int|float|null $string, int $length, string $substring = '…'): string |
|
138 | + public function truncate(string | int | float | null $string, int $length, string $substring = '…'): string |
|
139 | 139 | { |
140 | - $result = (string)$string; |
|
140 | + $result = (string) $string; |
|
141 | 141 | |
142 | 142 | if (!empty($string)) { |
143 | 143 | $string = strip_tags($string); |
144 | - $result = (string)Stringy::create($string)->truncate($length, $substring); |
|
144 | + $result = (string) Stringy::create($string)->truncate($length, $substring); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $result; |
@@ -159,13 +159,13 @@ discard block |
||
159 | 159 | * |
160 | 160 | * @return string with the resulting $str after truncating |
161 | 161 | */ |
162 | - public function truncateOnWord(string|int|float|null $string, int $length, string $substring = '…'): string |
|
162 | + public function truncateOnWord(string | int | float | null $string, int $length, string $substring = '…'): string |
|
163 | 163 | { |
164 | - $result = (string)$string; |
|
164 | + $result = (string) $string; |
|
165 | 165 | |
166 | 166 | if (!empty($string)) { |
167 | 167 | $string = strip_tags($string); |
168 | - $result = (string)Stringy::create($string)->safeTruncate($length, $substring); |
|
168 | + $result = (string) Stringy::create($string)->safeTruncate($length, $substring); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $result; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @return Stringy |
186 | 186 | */ |
187 | - public function stringy(string|int|float|null $string = '', ?string $encoding = null): Stringy |
|
187 | + public function stringy(string | int | float | null $string = '', ?string $encoding = null): Stringy |
|
188 | 188 | { |
189 | 189 | return Stringy::create($string, $encoding); |
190 | 190 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * |
207 | 207 | * @return string the formatted result. |
208 | 208 | */ |
209 | - public function humanFileSize(string|int|float $bytes, int $decimals = 1): string |
|
209 | + public function humanFileSize(string | int | float $bytes, int $decimals = 1): string |
|
210 | 210 | { |
211 | 211 | $oldSize = Craft::$app->formatter->sizeFormatBase; |
212 | 212 | Craft::$app->formatter->sizeFormatBase = 1000; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * |
248 | 248 | * @return string the formatted duration. |
249 | 249 | */ |
250 | - public function humanDuration(DateInterval|string|int $value): string |
|
250 | + public function humanDuration(DateInterval | string | int $value): string |
|
251 | 251 | { |
252 | 252 | return Craft::$app->formatter->asDuration($value); |
253 | 253 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * |
291 | 291 | * @return string the formatted result. |
292 | 292 | */ |
293 | - public function humanRelativeTime(int|string|DateTime|DateInterval $value, null|int|string|DateTime $referenceTime = null): string |
|
293 | + public function humanRelativeTime(int | string | DateTime | DateInterval $value, null | int | string | DateTime $referenceTime = null): string |
|
294 | 294 | { |
295 | 295 | return Craft::$app->formatter->asRelativeTime($value, $referenceTime); |
296 | 296 | } |
@@ -370,6 +370,6 @@ discard block |
||
370 | 370 | $words = preg_split("/[\s]+/u", strip_tags($string)); |
371 | 371 | $result = implode(' ', array_slice($words, 0, $length)); |
372 | 372 | |
373 | - return count($words) > $length ? $result . $substring : $result; |
|
373 | + return count($words) > $length ? $result.$substring : $result; |
|
374 | 374 | } |
375 | 375 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @return Markup |
41 | 41 | */ |
42 | - public function typogrify(string|int|float|null $text, bool $isTitle = false): Markup |
|
42 | + public function typogrify(string | int | float | null $text, bool $isTitle = false): Markup |
|
43 | 43 | { |
44 | 44 | $text = $this->normalizeText($text); |
45 | 45 | return Template::raw(Typogrify::$plugin->typogrify->typogrify($text, $isTitle)); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return Markup |
59 | 59 | */ |
60 | - public function typogrifyFeed(string|int|float|null $text, bool $isTitle = false): Markup |
|
60 | + public function typogrifyFeed(string | int | float | null $text, bool $isTitle = false): Markup |
|
61 | 61 | { |
62 | 62 | $text = $this->normalizeText($text); |
63 | 63 | return Template::raw(Typogrify::$plugin->typogrify->typogrifyFeed($text, $isTitle)); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return Markup |
70 | 70 | */ |
71 | - public function smartypants(string|int|float|null $text): Markup |
|
71 | + public function smartypants(string | int | float | null $text): Markup |
|
72 | 72 | { |
73 | 73 | $text = $this->normalizeText($text); |
74 | 74 | return Template::raw(Typogrify::$plugin->typogrify->smartypants($text)); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @return string with the resulting $str after truncating |
95 | 95 | */ |
96 | - public function truncate(string|int|float|null $string, int $length, string $substring = '…'): string |
|
96 | + public function truncate(string | int | float | null $string, int $length, string $substring = '…'): string |
|
97 | 97 | { |
98 | 98 | return Typogrify::$plugin->typogrify->truncate($string, $length, $substring); |
99 | 99 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return string with the resulting $str after truncating |
112 | 112 | */ |
113 | - public function truncateOnWord(string|int|float|null $string, int $length, string $substring = '…'): string |
|
113 | + public function truncateOnWord(string | int | float | null $string, int $length, string $substring = '…'): string |
|
114 | 114 | { |
115 | 115 | return Typogrify::$plugin->typogrify->truncateOnWord($string, $length, $substring); |
116 | 116 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * |
128 | 128 | * @return Stringy |
129 | 129 | */ |
130 | - public function stringy(string|int|float|null $string = '', ?string $encoding = null): Stringy |
|
130 | + public function stringy(string | int | float | null $string = '', ?string $encoding = null): Stringy |
|
131 | 131 | { |
132 | 132 | return Typogrify::$plugin->typogrify->stringy($string, $encoding); |
133 | 133 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * |
146 | 146 | * @return string the formatted result. |
147 | 147 | */ |
148 | - public function humanFileSize(string|int|float $bytes, int $decimals = 1): string |
|
148 | + public function humanFileSize(string | int | float $bytes, int $decimals = 1): string |
|
149 | 149 | { |
150 | 150 | return Typogrify::$plugin->typogrify->humanFileSize($bytes, $decimals); |
151 | 151 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @return string the formatted duration. |
167 | 167 | */ |
168 | - public function humanDuration(DateInterval|string|int $value): string |
|
168 | + public function humanDuration(DateInterval | string | int $value): string |
|
169 | 169 | { |
170 | 170 | return Typogrify::$plugin->typogrify->humanDuration($value); |
171 | 171 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * |
194 | 194 | * @return string the formatted result. |
195 | 195 | */ |
196 | - public function humanRelativeTime(int|string|DateTime|DateInterval $value, null|int|string|DateTime $referenceTime = null): string |
|
196 | + public function humanRelativeTime(int | string | DateTime | DateInterval $value, null | int | string | DateTime $referenceTime = null): string |
|
197 | 197 | { |
198 | 198 | return Typogrify::$plugin->typogrify->humanRelativeTime($value, $referenceTime); |
199 | 199 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | if (empty($text)) { |
304 | 304 | $text = ''; |
305 | 305 | } |
306 | - $text = (string)$text; |
|
306 | + $text = (string) $text; |
|
307 | 307 | |
308 | 308 | $settings = Typogrify::$plugin->getSettings(); |
309 | 309 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | return static function(ECSConfig $ecsConfig): void { |
7 | 7 | $ecsConfig->paths([ |
8 | - __DIR__ . '/src', |
|
8 | + __DIR__.'/src', |
|
9 | 9 | __FILE__, |
10 | 10 | ]); |
11 | 11 | $ecsConfig->parallel(); |