mirror of
https://github.com/Chouchen/Shikiryu_Backup.git
synced 2026-09-24 16:03:54 +02:00
Going namespaced, going scenario style
This commit is contained in:
1 parent
dbcd02c2af
commit
c593f32378
12 files changed
+134
-31
No files matched your search
@@ -0,0 +1,20 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user