Skip to content

PHP Deprecated: Required parameter $contentType follows optional parameter $filename #21

Closed
@bfoosness

Description

@bfoosness

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

public function send($filename = null, $contentType, $inline = false)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions