type fixes

This commit is contained in:
Yuri Kuznetsov
2022-03-13 14:19:38 +02:00
parent 120d090215
commit a164c33829
6 changed files with 22 additions and 7 deletions
@@ -33,9 +33,11 @@ use Psr\Http\Message\StreamInterface;
use GuzzleHttp\Psr7\Stream;
use RuntimeException;
class ContentsString implements Contents
{
private $contents;
private string $contents;
private function __construct(string $contents)
{
@@ -46,6 +48,10 @@ class ContentsString implements Contents
{
$resource = fopen('php://temp', 'r+');
if ($resource === false) {
throw new RuntimeException("Could not open temp.");
}
fwrite($resource, $this->getString());
rewind($resource);