1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 10:41:24 +02:00
Files
php-flarum/src/Frontend/Compiler/Source/SourceCollector.php
Sami Mazouz 7bceda976b Backend cleanup (#2859)
* 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>
2021-05-13 15:26:24 +01:00

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;
}
}