Upgrade to 4.1.1
This commit is contained in:
@@ -105,6 +105,14 @@ trait FileModifications
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sharpens the image
|
||||
*/
|
||||
public function sharpen(int $amount = 50): FileVersion|File|Asset
|
||||
{
|
||||
return $this->thumb(['sharpen' => $amount]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a srcset definition for the given sizes
|
||||
* Sizes can be defined as a simple array. They can
|
||||
|
@@ -62,10 +62,11 @@ enum LicenseStatus: string
|
||||
/**
|
||||
* Returns the dialog according to the status
|
||||
*/
|
||||
public function dialog(): string
|
||||
public function dialog(): string|null
|
||||
{
|
||||
return match ($this) {
|
||||
static::Missing => 'registration',
|
||||
static::Demo => null,
|
||||
default => 'license'
|
||||
};
|
||||
}
|
||||
|
@@ -277,6 +277,15 @@ class File
|
||||
if (is_array($rules['mime'] ?? null) === true) {
|
||||
$mime = $this->mime();
|
||||
|
||||
// the MIME type could not be determined, but matching
|
||||
// to it was requested explicitly
|
||||
if ($mime === null) {
|
||||
throw new Exception([
|
||||
'key' => 'file.mime.missing',
|
||||
'data' => ['filename' => $this->filename()]
|
||||
]);
|
||||
}
|
||||
|
||||
// determine if any pattern matches the MIME type;
|
||||
// once any pattern matches, `$carry` is `true` and the rest is skipped
|
||||
$matches = array_reduce(
|
||||
|
@@ -306,6 +306,7 @@ class Remote
|
||||
* Decode the response content
|
||||
*
|
||||
* @param bool $array decode as array or object
|
||||
* @psalm-return ($array is true ? array|null : stdClass|null)
|
||||
*/
|
||||
public function json(bool $array = true): array|stdClass|null
|
||||
{
|
||||
|
@@ -35,7 +35,7 @@ class Panel
|
||||
/**
|
||||
* Normalize a panel area
|
||||
*/
|
||||
public static function area(string $id, array|string $area): array
|
||||
public static function area(string $id, array $area): array
|
||||
{
|
||||
$area['id'] = $id;
|
||||
$area['label'] ??= $id;
|
||||
|
@@ -488,7 +488,16 @@ class Str
|
||||
return $string;
|
||||
}
|
||||
|
||||
return static::substr($string, 0, mb_strrpos(static::substr($string, 0, $chars), ' ')) . $rep;
|
||||
// shorten the string to the specified number of characters,
|
||||
// but make sure to not cut off in the middle of a word
|
||||
$excerpt = static::substr($string, 0, $chars);
|
||||
$cutoff = mb_strrpos($excerpt, ' ');
|
||||
|
||||
if ($cutoff !== false) {
|
||||
$excerpt = static::substr($string, 0, $cutoff);
|
||||
}
|
||||
|
||||
return $excerpt . $rep;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user