47 private $resolvedFile;
52 private $minification;
57 private $sourceContentType;
80 $this->minification = $minification;
88 return $this->context->getBaseUrl() . $this->
getPath();
126 $sourcePath = $this->source->findSource($this);
128 $origExt = pathinfo(
$path, PATHINFO_EXTENSION);
129 $ext = pathinfo($sourcePath, PATHINFO_EXTENSION);
130 $path = str_replace(
'.' . $origExt,
'.' . $ext, $this->filePath);
157 if (
null === $this->resolvedFile) {
158 $this->resolvedFile = $this->source->getFile($this);
159 if (
false === $this->resolvedFile) {
160 throw new File\NotFoundException(
"Unable to resolve the source file for '{$this->getPath()}'");
163 return $this->resolvedFile;
174 if ($this->sourceContentType ===
null) {
175 $this->sourceContentType = $this->source->getSourceContentType($this);
177 return $this->sourceContentType;
185 $content = $this->source->getContent($this);
187 throw new File\NotFoundException(
"Unable to get content for '{$this->getPath()}'");
__construct(Source $source, ContextInterface $context, $filePath, $module, $contentType, Minification $minification)
getRelativeSourceFilePath()