Skip to content

Commit 3ab5fcc

Browse files
committed
v3.8
1 parent 6db6a36 commit 3ab5fcc

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/Stream/FileStream.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ public function __construct(string $filename, string $mode)
2929
parent::__construct(self::openFile($filename, $mode));
3030
}
3131

32+
public function getFilename(): string
33+
{
34+
/** @var string $filename */
35+
$filename = $this->getMetadata('uri');
36+
37+
return $filename;
38+
}
39+
3240
/**
3341
* @return resource
3442
*
@@ -46,7 +54,7 @@ private static function openFile(string $filename, string $mode)
4654
throw new InvalidArgumentException(sprintf(
4755
'Unable to open the file "%s" in the mode "%s"',
4856
$filename,
49-
$mode
57+
$mode,
5058
));
5159
}
5260

src/Stream/TempFileStream.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ public function __construct(string $prefix = '')
3030
parent::__construct(self::createFile($prefix));
3131
}
3232

33+
public function getFilename(): string
34+
{
35+
/** @var string $filename */
36+
$filename = $this->getMetadata('uri');
37+
38+
return $filename;
39+
}
40+
3341
/**
3442
* @return resource
3543
*

src/Stream/TmpfileStream.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ public function __construct()
3434
parent::__construct(self::createFile());
3535
}
3636

37+
public function getFilename(): string
38+
{
39+
/** @var string $filename */
40+
$filename = $this->getMetadata('uri');
41+
42+
return $filename;
43+
}
44+
3745
/**
3846
* @return resource
3947
*

0 commit comments

Comments
 (0)