Changeset View
Changeset View
Standalone View
Standalone View
src/Runner/TasksMap.php
- This file was added.
<?php | |||||
namespace Nasqueron\SAAS\PhpBB\Runner; | |||||
use InvalidArgumentException; | |||||
use Nasqueron\SAAS\PhpBB\Tasks\BootstrapSqliteRepository; | |||||
class TasksMap { | |||||
public static function getMap () : array { | |||||
return [ | |||||
'sites:bootstrap' => BootstrapSqliteRepository::class, | |||||
]; | |||||
} | |||||
public static function getTaskClassName (string $command) { | |||||
foreach (self::getMap() as $taskCommand => $taskClassName) { | |||||
if ($command === $taskCommand) { | |||||
return $taskClassName; | |||||
} | |||||
} | |||||
throw new InvalidArgumentException; | |||||
} | |||||
} |
Nasqueron DevCentral · If it had been much bigger the moon would have had a core of ice. · Powered by Phabricator