Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
5 / 5 |
InputFileFromFile | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
5 / 5 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
copyTo | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
getStreamOrString | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
<?php | |
namespace Shellbox\Command; | |
use Shellbox\FileUtils; | |
/** | |
* Encapsulation of an input file that is copied from another file | |
* | |
* @internal | |
*/ | |
class InputFileFromFile extends InputFile { | |
/** @var string */ | |
private $path; | |
/** | |
* @param string $path | |
*/ | |
public function __construct( $path ) { | |
$this->path = $path; | |
} | |
public function copyTo( $destPath ) { | |
FileUtils::copy( $this->path, $destPath ); | |
} | |
public function getStreamOrString() { | |
return FileUtils::openInputFileStream( $this->path ); | |
} | |
} |