The function plupload_file_uri_to_object()
says in the docblock
@return boolean
- * A file object, or FALSE on error.
This is wrong in two ways. Firstly if it was to return a file object or boolean then the @return
should be either boolean|\stdClass
or mixed
. However, as the function creates a new stdClass and returns that (there is no conditional to return something else), it won't ever return a bool.
This will cause a problem in an IDE such as PHPStorm because if you want to call plupload_file_uri_to_object() it expects a boolean but in fact a stdClass object is returned.
Also there is a line that says $wrapper = file_stream_wrapper_get_instance_by_uri($uri);
but $wrapper
is never used so that can be removed.
Patch coming up.
Comment | File | Size | Author |
---|---|---|---|
#2 | plupload-fixed-docblock-2913794-2.patch | 826 bytes | DrupalGideon |
Comments
Comment #2
DrupalGideonComment #3
DrupalGideon