Upgrade to 3.6.2

This commit is contained in:
Bastian Allgeier
2022-02-01 11:42:39 +01:00
parent f62d1a39ca
commit 848ea36dcf
108 changed files with 2887 additions and 2622 deletions

View File

@@ -306,9 +306,11 @@ class File
// determine if any pattern matches the MIME type;
// once any pattern matches, `$carry` is `true` and the rest is skipped
$matches = array_reduce($rules['mime'], function ($carry, $pattern) use ($mime) {
return $carry || Mime::matches($mime, $pattern);
}, false);
$matches = array_reduce(
$rules['mime'],
fn ($carry, $pattern) => $carry || Mime::matches($mime, $pattern),
false
);
if ($matches !== true) {
throw new Exception([
@@ -416,11 +418,14 @@ class File
* Returns the file size in a
* human-readable format
*
* @param string|null|false $locale Locale for number formatting,
* `null` for the current locale,
* `false` to disable number formatting
* @return string
*/
public function niceSize(): string
public function niceSize($locale = null): string
{
return F::niceSize($this->root);
return F::niceSize($this->root, $locale);
}
/**