Upgrade to 4.5.0

This commit is contained in:
Bastian Allgeier
2024-11-28 11:24:28 +01:00
parent 49287c7a5e
commit 63ddf40692
86 changed files with 942 additions and 491 deletions

View File

@@ -96,8 +96,6 @@ class Collection extends Iterator implements Countable
* Low-level setter for elements
*
* @param string $key string or array
* @param mixed $value
* @return void
*/
public function __set(string $key, $value): void
{

View File

@@ -102,4 +102,12 @@ class Obj extends stdClass
{
return json_encode($this->toArray(), ...$arguments);
}
/**
* Returns the property names as keys
*/
public function toKeys(): array
{
return array_keys((array)$this);
}
}

View File

@@ -1132,7 +1132,7 @@ class Str
string $string = null,
string $separator = null,
string $allowed = null,
int $maxlength = 128
int|false $maxlength = 128
): string {
$separator ??= static::$defaults['slug']['separator'];
$allowed ??= static::$defaults['slug']['allowed'];
@@ -1165,7 +1165,11 @@ class Str
$string = preg_replace('![^a-z0-9]+$!', '', $string);
// cut the string after the given maxlength
return static::short($string, $maxlength, '');
if ($maxlength !== false) {
$string = static::short($string, $maxlength, '');
}
return $string;
}
/**