mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 02:36:52 +01:00
42 lines
877 B
PHP
42 lines
877 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rector\FileSystemRector\ValueObject;
|
|
|
|
use Rector\Core\Exception\ShouldNotHappenException;
|
|
use Rector\FileSystemRector\Contract\AddedFileInterface;
|
|
|
|
final class AddedFileWithContent implements AddedFileInterface
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $filePath;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $fileContent;
|
|
|
|
public function __construct(string $filePath, string $fileContent)
|
|
{
|
|
if ($filePath === $fileContent) {
|
|
throw new ShouldNotHappenException('File path and content are the same, probably a bug');
|
|
}
|
|
|
|
$this->filePath = $filePath;
|
|
$this->fileContent = $fileContent;
|
|
}
|
|
|
|
public function getFilePath(): string
|
|
{
|
|
return $this->filePath;
|
|
}
|
|
|
|
public function getFileContent(): string
|
|
{
|
|
return $this->fileContent;
|
|
}
|
|
}
|