phpstan update
Better typying
This commit is contained in:
parent
74db3b9ad0
commit
6adc1df213
17 changed files with 166 additions and 158 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
namespace Alltube\Stream;
|
||||
|
||||
use Alltube\Exception\EmptyUrlException;
|
||||
use Alltube\Exception\PasswordException;
|
||||
use Alltube\Video;
|
||||
use Barracuda\ArchiveStream\ZipArchive;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
@ -86,20 +88,21 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
|
|||
*
|
||||
* @param string $string The string that is to be written
|
||||
*
|
||||
* @return void
|
||||
* @return int|false
|
||||
*/
|
||||
public function write($string)
|
||||
{
|
||||
fwrite($this->buffer, $string);
|
||||
return fwrite($this->buffer, $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size of the stream if known.
|
||||
*
|
||||
* @return void
|
||||
* @return int|null
|
||||
*/
|
||||
public function getSize()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +148,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
|
|||
/**
|
||||
* Returns the remaining contents in a string.
|
||||
*
|
||||
* @return string
|
||||
* @return string|false
|
||||
*/
|
||||
public function getContents()
|
||||
{
|
||||
|
@ -196,7 +199,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
|
|||
{
|
||||
$this->rewind();
|
||||
|
||||
return $this->getContents();
|
||||
return strval($this->getContents());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -238,6 +241,8 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
|
|||
* @param Video $video Video to stream
|
||||
*
|
||||
* @return void
|
||||
* @throws PasswordException
|
||||
* @throws EmptyUrlException
|
||||
*/
|
||||
protected function startVideoStream(Video $video)
|
||||
{
|
||||
|
@ -248,7 +253,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
|
|||
|
||||
$this->init_file_stream_transfer(
|
||||
$video->getFilename(),
|
||||
$contentLengthHeaders[0]
|
||||
intval($contentLengthHeaders[0])
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue