Update to Kirby 5
This commit is contained in:
parent
5d9979fca8
commit
0fefc5e2e1
472 changed files with 30853 additions and 10301 deletions
|
@ -34,7 +34,9 @@ return [
|
|||
$parent = $this->uploadParent($uploads['parent'] ?? null);
|
||||
|
||||
if ($parent === null) {
|
||||
throw new InvalidArgumentException('"' . $uploads['parent'] . '" could not be resolved as a valid parent for the upload');
|
||||
throw new InvalidArgumentException(
|
||||
message: '"' . $uploads['parent'] . '" could not be resolved as a valid parent for the upload'
|
||||
);
|
||||
}
|
||||
|
||||
$file = new File([
|
||||
|
@ -52,7 +54,9 @@ return [
|
|||
'methods' => [
|
||||
'upload' => function (Api $api, $params, Closure $map) {
|
||||
if ($params === false) {
|
||||
throw new Exception('Uploads are disabled for this field');
|
||||
throw new Exception(
|
||||
message: 'Uploads are disabled for this field'
|
||||
);
|
||||
}
|
||||
|
||||
$parent = $this->uploadParent($params['parent'] ?? null);
|
||||
|
@ -68,7 +72,9 @@ return [
|
|||
$file = $parent->createFile($props, true);
|
||||
|
||||
if ($file instanceof File === false) {
|
||||
throw new Exception('The file could not be uploaded');
|
||||
throw new Exception(
|
||||
message: 'The file could not be uploaded'
|
||||
);
|
||||
}
|
||||
|
||||
return $map($file, $parent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue