-
Notifications
You must be signed in to change notification settings - Fork 17
PHP Deprecated: Required parameter $contentType follows optional parameter $filename #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks, will have a look. Maybe we should use I first thought about making the |
Yeah, if you think that's a reasonable default, that could be a good solution. There shouldn't be any calls to this method without a content type now, so any immediate consequences to this default value should be minimal to none, making it a safe change. |
I've created an initial attempt at a fix if you'd like to discuss it. Unfortunately there are no tests covering the send method. |
Issue #21 Fix deprecation warning in PHP8
@bfoosness Just released 1.1.7 including this fix. Thanks for your help. |
Thanks so much! |
This line results in a deprecation error in PHP 8:
PHP Deprecated: Required parameter $contentType follows optional parameter $filename in /site/vendor/mikehaertl/php-tmpfile/src/File.php on line 73
php-tmpfile/src/File.php
Line 73 in 20a1879
I'm happy to create a PR if you have a preferred solution. Changing the parameter order or requiring the first parameter would be a BC break. Alternatively, a default value of null could be added to
$contentType
(turning it into an optional parameter) and then an exception thrown if it remains null.The text was updated successfully, but these errors were encountered: