protected static function getFilename($check)
    {
        if ($check instanceof UploadedFileInterface) {
            try {
                // Uploaded files throw exceptions on upload errors.
                return $check->getStream()->getMetadata('uri');
            } catch (RuntimeException $e) {
                return false;
            }
        }
        if (is_array($check) && isset($check['tmp_name'])) {
            return $check['tmp_name'];
        }

        if (is_string($check)) {
            return $check;
        }

        return false;
    }
protected static function getFilename($check)
    {
        if ($check instanceof UploadedFileInterface) {
            try {
                // Uploaded files throw exceptions on upload errors.
                return $check->getStream()->getMetadata('uri');
            } catch (RuntimeException $e) {
                return false;
            }
        }
        if (is_array($check) && isset($check['tmp_name'])) {
            return $check['tmp_name'];
        }

        if (is_string($check)) {
            return $check;
        }

        return false;
    }
protected static function getFilename ( $ check ) { if ( $ check instanceof UploadedFileInterface ) { try { // Uploaded files throw exceptions on upload errors. return $ check -> getStream ( ) -> getMetadata ( 'uri' ) ; } catch ( RuntimeException $ e ) { return false ; } } if ( is_array ( $ check ) && isset ( $ check [ 'tmp_name' ] ) ) { return $ check [ 'tmp_name' ] ; } if ( is_string ( $ check ) ) { return $ check ; } return false ; }
Helper for reading the file out of the various file implementations
we accept.

@param string|array|\Psr\Http\Message\UploadedFileInterface $check The data to read a filename out of.
@return string|bool Either the filename or false on failure.
Helper for reading the file out of the various file implementations we accept .