StreamFactory.php 559 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Http\Message;
  3. use Psr\Http\Message\StreamInterface;
  4. /**
  5. * Factory for PSR-7 Stream.
  6. *
  7. * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
  8. */
  9. interface StreamFactory
  10. {
  11. /**
  12. * Creates a new PSR-7 stream.
  13. *
  14. * @param string|resource|StreamInterface|null $body
  15. *
  16. * @return StreamInterface
  17. *
  18. * @throws \InvalidArgumentException If the stream body is invalid.
  19. * @throws \RuntimeException If creating the stream from $body fails.
  20. */
  21. public function createStream($body = null);
  22. }