| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace TypistTech\Imposter; |
| 6 |
|
| 7 |
class ConfigFactory |
| 8 |
{ |
| 9 |
public static function build(string $path, Filesystem $filesystem): Config |
| 10 |
{ |
| 11 |
return new Config( |
| 12 |
$filesystem->dirname($path), |
| 13 |
json_decode( |
| 14 |
$filesystem->get($path), |
| 15 |
true |
| 16 |
) |
| 17 |
); |
| 18 |
} |
| 19 |
|
| 20 |
public static function buildProjectConfig(string $path, Filesystem $filesystem): ProjectConfig |
| 21 |
{ |
| 22 |
return new ProjectConfig( |
| 23 |
$filesystem->dirname($path), |
| 24 |
json_decode( |
| 25 |
$filesystem->get($path), |
| 26 |
true |
| 27 |
) |
| 28 |
); |
| 29 |
} |
| 30 |
} |
| 31 |
|