hotfix: Stubs for structured rewrite

This commit is contained in:
Chris 2016-12-11 16:15:36 +01:00
parent 2f1628b7d8
commit 0b5ed81b78
9 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<?php
namespace NoccyLabs\Hotfix\Exception;
use Exception;
class HotfixException extends Exception
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace NoccyLabs\Hotfix\Exception;
class NotCompatibleException extends HotfixException
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace NoccyLabs\Hotfix\Exception;
class NotImplementedException extends HotfixException
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace NoccyLabs\Hotfix\Exception;
class UnsupportedRunnerException extends HotfixException
{
}

24
src/Runner/BashRunner.php Normal file
View File

@ -0,0 +1,24 @@
<?php
namespace NoccyLabs\Hotfix\Runner;
use NoccyLabs\Hotfix\System\Facts;
use NoccyLabs\Hotfix\Hotfix\Hotfix;
/**
* Run hotfixes written in BASH/DASH script.
*
*
*/
class BashRunner implements RunnerInterface
{
public function prepare(Hotfix $hotfix, Facts $facts)
{
}
public function apply()
{
}
}

24
src/Runner/PhpRunner.php Normal file
View File

@ -0,0 +1,24 @@
<?php
namespace NoccyLabs\Hotfix\Runner;
use NoccyLabs\Hotfix\System\Facts;
use NoccyLabs\Hotfix\Hotfix\Hotfix;
/**
* Run hotfixes written in PHP
*
*
*/
class PhpRunner implements RunnerInterface
{
public function prepare(Hotfix $hotfix, Facts $facts)
{
}
public function apply()
{
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace NoccyLabs\Hotfix\Runner;
use NoccyLabs\Hotfix\System\Facts;
use NoccyLabs\Hotfix\Hotfix\Hotfix;
/**
* Run hotfixes written in Python.
*
*
*/
class PythonRunner implements RunnerInterface
{
public function prepare(Hotfix $hotfix, Facts $facts)
{
throw new NotImplementedException("The Python runner is not implemented");
}
public function apply()
{
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace NoccyLabs\Hotfix\Runner;
use NoccyLabs\Hotfix\System\Facts;
use NoccyLabs\Hotfix\Hotfix\Hotfix;
use NoccyLabs\Hotfix\Exception\UnsupportedRunnerException;
use NoccyLabs\Hotfix\Exception\NotCompatibleException;
class RunnerFactory
{
public static function createRunner(Hotfix $hotfix)
{
$facts = Facts::getSystemFacts();
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace NoccyLabs\Hotfix\Runner;
use NoccyLabs\Hotfix\System\Facts;
use NoccyLabs\Hotfix\Hotfix\Hotfix;
interface RunnerInterface
{
public function applyHotfix(Hotfix $hotfix, Facts $facts);
}