You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior
Update fof/upload from 1.5.8 to 1.6.0 throws the following deprectation error:
Deprecated: Optional parameter $upload declared before required parameter $contents is implicitly treated as a required parameter in ./vendor/fof/upload/src/Adapters/Flysystem.php on line 55
Environment
Flarum version: 1.8.9
Extension version: ^1.6.0
Webserver: apache
Hosting environment: local development server
PHP version: 8.2.25
Possible solution(s)
Switching off deprecation warnings is not a good idea because
a) I want to have them enabled on the dev server, and
b) we should fix deprecations in order to not run into any problems in the future.
# change line 55 frompublicfunction upload(File$file, ?UploadedFile$upload = null, $contents)
# into
public function upload(File$file, ?UploadedFile$upload, $contents)
This gets rid of the error. And as UploadedFile is explicitly nullable, it should be ok, right? This is where I am not sure if we will run into any problems if a caller does not specify UploadedFile.
Additional Context
Duplicate of #407 which has already been closed.
The text was updated successfully, but these errors were encountered:
Bug Report
Current Behavior
Update fof/upload from 1.5.8 to 1.6.0 throws the following deprectation error:
Environment
Possible solution(s)
Switching off deprecation warnings is not a good idea because
a) I want to have them enabled on the dev server, and
b) we should fix deprecations in order to not run into any problems in the future.
As of php 8.0 having an optional parameter followed by a required one is deprecated. (https://www.php.net/manual/en/migration80.deprecated.php)
It is recommended to use a explicit nullable type instead.
Suggestion:
This gets rid of the error. And as UploadedFile is explicitly nullable, it should be ok, right? This is where I am not sure if we will run into any problems if a caller does not specify UploadedFile.
Additional Context
Duplicate of #407 which has already been closed.
The text was updated successfully, but these errors were encountered: