for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is a part of Sculpin.
*
* (c) Dragonfly Development Inc.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symplify\PHP7_Sculpin\Output;
use Symplify\PHP7_Sculpin\Permalink\Permalink;
use Symplify\PHP7_Sculpin\Source\SourceInterface;
use SplFileInfo;
final class SourceOutput
{
/**
* @var SourceInterface
private $source;
public function __construct(SourceInterface $source)
$this->source = $source;
}
* {@inheritdoc}
public function outputId() : string
return $this->source->sourceId();
* Pathname (relative).
public function pathname() : string
return $this->source->relativePathname();
* Suggested permalink.
public function permalink() : Permalink
return $this->source->permalink();
public function hasFileReference() : bool
return $this->source->useFileReference();
* @return SplFileInfo|null
public function file()
return $this->source->useFileReference() ? $this->source->file() : null;
* Formatted content (if not hasFileReference).
* @return string|null
public function formattedContent()
return $this->source->useFileReference() ? null : $this->source->formattedContent();