mirror of
https://github.com/flarum/core.git
synced 2025-07-25 10:41:24 +02:00
* Extender docblocks cleanup * Excplicit type hinting in extenders * Bring method under constructor * Mark some classes and methods as internal * Remove beta references Co-authored-by: Clark Winkelmann <clark.winkelmann@gmail.com>
52 lines
873 B
PHP
52 lines
873 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* For detailed copyright and license information, please view the
|
|
* LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Frontend\Compiler\Source;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class SourceCollector
|
|
{
|
|
/**
|
|
* @var SourceInterface[]
|
|
*/
|
|
protected $sources = [];
|
|
|
|
/**
|
|
* @param string $file
|
|
* @return $this
|
|
*/
|
|
public function addFile(string $file)
|
|
{
|
|
$this->sources[] = new FileSource($file);
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
* @return $this
|
|
*/
|
|
public function addString(callable $callback)
|
|
{
|
|
$this->sources[] = new StringSource($callback);
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return SourceInterface[]
|
|
*/
|
|
public function getSources()
|
|
{
|
|
return $this->sources;
|
|
}
|
|
}
|