Removed incomplete plugin stub

This commit is contained in:
Chris 2021-12-22 02:46:58 +01:00
parent 94240a06f2
commit 80c7c894ab

View File

@ -1,42 +0,0 @@
<?php // "name":"Build stuff from stuff", "author":"Noccy"
namespace SparkPlug\Com\Noccy\Maker;
use Spark\Commands\Command;
use SparkPlug;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MakerPlug extends SparkPlug
{
public function load()
{
$config = json_decode(file_get_contents(get_environment()->getConfigDirectory()."/maker.json"), true);
foreach ($config as $rule=>$info) {
if (str_starts_with($rule, '@')) {
$rule = substr($rule, 1);
register_command(new class($rule) extends Command {
private $rule;
public function __construct($rule)
{
$this->rule = $rule;
parent::__construct();
}
protected function configure()
{
$this->setName("make:{$this->rule}");
$this->setDescription("Run the {$this->rule} maker task");
}
protected function execute(InputInterface $input, OutputInterface $output)
{
}
});
}
}
}
}
if (file_exists(get_environment()->getConfigDirectory()."/maker.json")) {
register_plugin("com.noccy.maker", new MakerPlug());
}