Skip to content

Commit

Permalink
(#302) Moved getRenderedContent method to AbstractSource
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve committed Feb 23, 2018
1 parent 0beeed3 commit af28822
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
15 changes: 15 additions & 0 deletions src/Modules/Source/AbstractSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,21 @@ public function getCompiledPermalink(): string
return $this->permalink->getCompiled($this, $pretty);
}

/**
* Returns the file content, this will be excluding any frontmatter.
*
* @throws \Exception
* @return string
*/
public function getRenderedContent(): string
{
if (! $this->hasContent()) {
throw new \Exception('The file ['.$this->getRelativePathname().'] has not been loaded.');
}

return $this->content;
}

/**
* Get the filename.
* Without the file extension.
Expand Down
15 changes: 0 additions & 15 deletions src/Modules/Source/MemorySource.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,6 @@ public function setRenderedContent(string $content)
$this->content = $content;
}

/**
* Returns the file content, this will be excluding any frontmatter.
*
* @throws \Exception
* @return string
*/
public function getRenderedContent(): string
{
if (! $this->hasContent()) {
throw new \Exception('The file ['.$this->getRelativePathname().'] has not been loaded.');
}

return $this->content;
}

/**
* Gets the filename.
*
Expand Down
15 changes: 0 additions & 15 deletions src/Modules/Source/SplFileSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ public function setRenderedContent(string $content)
$this->content = $content;
}

/**
* Returns the file content, this will be excluding any frontmatter.
*
* @throws \Exception
* @return string
*/
public function getRenderedContent(): string
{
if (! $this->hasContent()) {
throw new \Exception('The file ['.$this->getRelativePathname().'] has not been loaded.');
}

return $this->content;
}

/**
* Gets the filename.
*
Expand Down

0 comments on commit af28822

Please sign in to comment.