Skip to content
Open

v3.8 #48

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Stream/FileStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public function __construct(string $filename, string $mode)
parent::__construct(self::openFile($filename, $mode));
}

public function getFilename(): string
{
/** @var string $filename */
$filename = $this->getMetadata('uri');

return $filename;
}

/**
* @return resource
*
Expand All @@ -46,7 +54,7 @@ private static function openFile(string $filename, string $mode)
throw new InvalidArgumentException(sprintf(
'Unable to open the file "%s" in the mode "%s"',
$filename,
$mode
$mode,
));
}

Expand Down
8 changes: 8 additions & 0 deletions src/Stream/TempFileStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ public function __construct(string $prefix = '')
parent::__construct(self::createFile($prefix));
}

public function getFilename(): string
{
/** @var string $filename */
$filename = $this->getMetadata('uri');

return $filename;
}

/**
* @return resource
*
Expand Down
8 changes: 8 additions & 0 deletions src/Stream/TmpfileStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public function __construct()
parent::__construct(self::createFile());
}

public function getFilename(): string
{
/** @var string $filename */
$filename = $this->getMetadata('uri');

return $filename;
}

/**
* @return resource
*
Expand Down