diff --git a/src/ssg/InputFile.php b/src/ssg/InputFile.php index 890c01f..2bb0340 100644 --- a/src/ssg/InputFile.php +++ b/src/ssg/InputFile.php @@ -24,11 +24,6 @@ public function __construct( $this->modifiedContent = $content; } - public function hasModifiedContent(): bool - { - return null !== $this->modifiedContent; - } - public function getContent(): string { return $this->modifiedContent ?? $this->getOriginalContent(); @@ -45,6 +40,11 @@ private function getOriginalContent(): string return $content; } + public function hasModifiedContent(): bool + { + return null !== $this->modifiedContent; + } + /** @param mixed[] $metadata */ public function withAdditionalMetadata(array $metadata): self { @@ -63,23 +63,23 @@ public function withContent(string $content): self ); } - public function withOutputPath(string $outputPath): self + /** @param mixed[] $metadata */ + public function withMetadata(array $metadata): self { return new self( $this->source, - $outputPath, - $this->metadata, + $this->outputPath, + $metadata, $this->hasModifiedContent() ? $this->getContent() : null, ); } - /** @param mixed[] $metadata */ - public function withMetadata(array $metadata): self + public function withOutputPath(string $outputPath): self { return new self( $this->source, - $this->outputPath, - $metadata, + $outputPath, + $this->metadata, $this->hasModifiedContent() ? $this->getContent() : null, ); }