|
static | compact (array $wraps) |
| Merge consecutive WrappedString objects with the same prefix and suffix.
|
|
static | join ( $sep, array $wraps) |
| Join several wrapped strings with a separator between each.
|
|
◆ __construct()
Wikimedia\WrappedString::__construct |
( |
| $value, |
|
|
| $prefix = null, |
|
|
| $suffix = null ) |
- Parameters
-
string | $value | |
string | null | $prefix | |
string | null | $suffix | |
◆ __toString()
Wikimedia\WrappedString::__toString |
( |
| ) |
|
◆ compact()
static Wikimedia\WrappedString::compact |
( |
array | $wraps | ) |
|
|
static |
Merge consecutive WrappedString objects with the same prefix and suffix.
Does not modify the array or the WrappedString objects.
NOTE: This is an internal method. Use join() or WrappedStringList instead.
- Parameters
-
array<string|WrappedString|WrappedStringList> | $wraps |
- Returns
- array<string|WrappedString|WrappedStringList> Compacted list to be treated as strings
◆ extend()
Wikimedia\WrappedString::extend |
( |
| $value | ) |
|
|
protected |
- Parameters
-
string | $value | Value of a WrappedString with the same prefix and suffix |
- Returns
- WrappedString Newly wrapped string
◆ join()
static Wikimedia\WrappedString::join |
( |
| $sep, |
|
|
array | $wraps ) |
|
static |
Join several wrapped strings with a separator between each.
This method is compatible with native PHP implode(). The actual join operation is deferred to WrappedStringList::__toString(). This allows callers to collect multiple lists and compact them together.
- Parameters
-
string | $sep | |
| (string|WrappedString|WrappedStringList)[] | $wraps |
- Returns
- WrappedStringList
The documentation for this class was generated from the following file: