Skip to content

Commit

Permalink
Stream now throws a RuntimeException.
Browse files Browse the repository at this point in the history
See http-interop/http-factory-tests@c29f9c5

Signed-off-by: ADmad <admad.coder@gmail.com>
  • Loading branch information
ADmad committed Nov 2, 2020
1 parent 3397e24 commit bfaeb97
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/Exception/RuntimeException.php
@@ -0,0 +1,15 @@
<?php

/**
* @see https://github.com/laminas/laminas-diactoros for the canonical source repository
* @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Laminas\Diactoros\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Stream.php
Expand Up @@ -347,7 +347,7 @@ private function setStream($stream, string $mode = 'r') : void
}

if ($error) {
throw new Exception\InvalidArgumentException('Invalid stream reference provided');
throw new Exception\RuntimeException('Invalid stream reference provided');
}

if (! $this->isValidStreamResourceType($resource)) {
Expand Down

0 comments on commit bfaeb97

Please sign in to comment.