mirror of
https://github.com/Chouchen/Shikiryu_Backup.git
synced 2021-06-30 16:02:14 +02:00
20 lines
403 B
PHP
20 lines
403 B
PHP
|
<?php
|
||
|
|
||
|
namespace Shikiryu\Backup\Backup;
|
||
|
|
||
|
class Factory
|
||
|
{
|
||
|
/**
|
||
|
* @param array $config
|
||
|
* @return BackupAbstract
|
||
|
*/
|
||
|
public static function build(array $config)
|
||
|
{
|
||
|
$class = array_keys($config)[0];
|
||
|
if (class_exists($class)) {
|
||
|
/* @var $instance BackupAbstract */
|
||
|
return new $class(array_values($config));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|