Skip to content

Commit

Permalink
"InputFile.php": Do some rearrangin'.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Aug 26, 2024
1 parent 328ffa5 commit e5e11a1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ssg/InputFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
{
Expand All @@ -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,
);
}
Expand Down

0 comments on commit e5e11a1

Please sign in to comment.