31
31
*/
32
32
abstract class AbstractString implements \JsonSerializable
33
33
{
34
- public const PREG_PATTERN_ORDER = \ PREG_PATTERN_ORDER ;
35
- public const PREG_SET_ORDER = \ PREG_SET_ORDER ;
36
- public const PREG_OFFSET_CAPTURE = \ PREG_OFFSET_CAPTURE ;
37
- public const PREG_UNMATCHED_AS_NULL = \ PREG_UNMATCHED_AS_NULL ;
34
+ public const PREG_PATTERN_ORDER = PREG_PATTERN_ORDER ;
35
+ public const PREG_SET_ORDER = PREG_SET_ORDER ;
36
+ public const PREG_OFFSET_CAPTURE = PREG_OFFSET_CAPTURE ;
37
+ public const PREG_UNMATCHED_AS_NULL = PREG_UNMATCHED_AS_NULL ;
38
38
39
39
public const PREG_SPLIT = 0 ;
40
- public const PREG_SPLIT_NO_EMPTY = \ PREG_SPLIT_NO_EMPTY ;
41
- public const PREG_SPLIT_DELIM_CAPTURE = \ PREG_SPLIT_DELIM_CAPTURE ;
42
- public const PREG_SPLIT_OFFSET_CAPTURE = \ PREG_SPLIT_OFFSET_CAPTURE ;
40
+ public const PREG_SPLIT_NO_EMPTY = PREG_SPLIT_NO_EMPTY ;
41
+ public const PREG_SPLIT_DELIM_CAPTURE = PREG_SPLIT_DELIM_CAPTURE ;
42
+ public const PREG_SPLIT_OFFSET_CAPTURE = PREG_SPLIT_OFFSET_CAPTURE ;
43
43
44
44
protected $ string = '' ;
45
45
protected $ ignoreCase = false ;
@@ -262,7 +262,7 @@ public function collapseWhitespace(): self
262
262
public function endsWith ($ suffix ): bool
263
263
{
264
264
if (!\is_array ($ suffix ) && !$ suffix instanceof \Traversable) {
265
- throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , \get_class ( $ this ) ));
265
+ throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , static ::class ));
266
266
}
267
267
268
268
foreach ($ suffix as $ s ) {
@@ -317,7 +317,7 @@ public function ensureStart(string $prefix): self
317
317
public function equalsTo ($ string ): bool
318
318
{
319
319
if (!\is_array ($ string ) && !$ string instanceof \Traversable) {
320
- throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , \get_class ( $ this ) ));
320
+ throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , static ::class ));
321
321
}
322
322
323
323
foreach ($ string as $ s ) {
@@ -351,7 +351,7 @@ public function ignoreCase(): self
351
351
public function indexOf ($ needle , int $ offset = 0 ): ?int
352
352
{
353
353
if (!\is_array ($ needle ) && !$ needle instanceof \Traversable) {
354
- throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , \get_class ( $ this ) ));
354
+ throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , static ::class ));
355
355
}
356
356
357
357
$ i = \PHP_INT_MAX ;
@@ -373,7 +373,7 @@ public function indexOf($needle, int $offset = 0): ?int
373
373
public function indexOfLast ($ needle , int $ offset = 0 ): ?int
374
374
{
375
375
if (!\is_array ($ needle ) && !$ needle instanceof \Traversable) {
376
- throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , \get_class ( $ this ) ));
376
+ throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , static ::class ));
377
377
}
378
378
379
379
$ i = null ;
@@ -536,7 +536,7 @@ public function split(string $delimiter, int $limit = null, int $flags = null):
536
536
public function startsWith ($ prefix ): bool
537
537
{
538
538
if (!\is_array ($ prefix ) && !$ prefix instanceof \Traversable) {
539
- throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , \get_class ( $ this ) ));
539
+ throw new \TypeError (sprintf ('Method "%s()" must be overridden by class "%s" to deal with non-iterable values. ' , __FUNCTION__ , static ::class ));
540
540
}
541
541
542
542
foreach ($ prefix as $ prefix ) {
0 commit comments