Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 6 |
InputFileFromStream | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 6 |
__construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
copyTo | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
getStreamOrString | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
<?php | |
namespace Shellbox\Command; | |
use GuzzleHttp\Psr7\Utils; | |
use Psr\Http\Message\StreamInterface; | |
use Shellbox\FileUtils; | |
class InputFileFromStream extends InputFile { | |
/** @var StreamInterface */ | |
private $stream; | |
public function __construct( StreamInterface $stream ) { | |
$this->stream = $stream; | |
} | |
public function copyTo( $destPath ) { | |
Utils::copyToStream( $this->stream, FileUtils::openOutputFileStream( $destPath ) ); | |
} | |
public function getStreamOrString() { | |
return $this->stream; | |
} | |
} |