Пример #1
0
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage Unable to open /path/to/does/not/exist using mode r
  */
 public function testThrowsExceptionNotWarning()
 {
     Util::tryFopen('/path/to/does/not/exist', 'r');
 }
Пример #2
0
 /**
  * Creates the underlying stream lazily when required.
  *
  * @return \Psr\Http\Message\StreamInterface
  */
 protected function createStream() : StreamInterface
 {
     return new Stream(Util::tryFopen($this->filename, $this->mode));
 }
Пример #3
0
 /**
  * @param string|resource $stream
  */
 public function __construct($stream = 'php://input')
 {
     $stream = Util::tryFopen($stream, 'r');
     $this->stream = new Stream($stream);
 }