-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathLoader.php
More file actions
41 lines (33 loc) · 963 Bytes
/
Loader.php
File metadata and controls
41 lines (33 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace TweakPHP\Client;
use TweakPHP\Client\Loaders\ComposerLoader;
use TweakPHP\Client\Loaders\LaravelLoader;
use TweakPHP\Client\Loaders\LoaderInterface;
use TweakPHP\Client\Loaders\PimcoreLoader;
use TweakPHP\Client\Loaders\SymfonyLoader;
use TweakPHP\Client\Loaders\WordPressLoader;
class Loader
{
/**
* @return null|LoaderInterface
*/
public static function load(string $path)
{
if (LaravelLoader::supports($path)) {
return new LaravelLoader($path);
}
if (SymfonyLoader::supports($path)) {
return new SymfonyLoader($path);
}
if (WordPressLoader::supports($path)) {
return new WordPressLoader($path);
}
if (PimcoreLoader::supports($path)) {
return new PimcoreLoader($path);
}
if (ComposerLoader::supports($path)) {
return new ComposerLoader($path);
}
return null;
}
}