CoreFiles by mySites.guru
StreamFactoryInterface.php45 lines, 1,418 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
4511e7ad5d1106c5c6a7adde87e1263b
sha1
b10b8e04007f552c2803edad59f6342074ca86aa
sha256
25fe9d048ce6718141d21c122ef9b3498be45025300717ccbe912ef5bc0083ec
<?php

namespace Psr\Http\Message;

interface StreamFactoryInterface
{
    /**
     * Create a new stream from a string.
     *
     * The stream SHOULD be created with a temporary resource.
     *
     * @param string $content String content with which to populate the stream.
     *
     * @return StreamInterface
     */
    public function createStream(string $content = ''): StreamInterface;

    /**
     * Create a stream from an existing file.
     *
     * The file MUST be opened using the given mode, which may be any mode
     * supported by the `fopen` function.
     *
     * The `$filename` MAY be any string supported by `fopen()`.
     *
     * @param string $filename Filename or stream URI to use as basis of stream.
     * @param string $mode Mode with which to open the underlying filename/stream.
     *
     * @return StreamInterface
     * @throws \RuntimeException If the file cannot be opened.
     * @throws \InvalidArgumentException If the mode is invalid.
     */
    public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface;

    /**
     * Create a new stream from an existing resource.
     *
     * The stream MUST be readable and may be writable.
     *
     * @param resource $resource PHP resource to use as basis of stream.
     *
     * @return StreamInterface
     */
    public function createStreamFromResource($resource): StreamInterface;
}

The same content is in 292 releases, Joomla 4.0.0-alpha10 to 6.3.0-alpha1. See them all, or every version of this file.