| Total Complexity | 6 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | class App |
||
| 26 | { |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Web app adapter |
||
| 30 | */ |
||
| 31 | const WEB = 'web'; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Console app adapter |
||
| 35 | */ |
||
| 36 | const CONSOLE = 'console'; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var string |
||
| 40 | */ |
||
| 41 | private static $baseDir; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var AppInterface |
||
| 45 | */ |
||
| 46 | private $adapter; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param AppInterface $adapter |
||
| 50 | */ |
||
| 51 | public function __construct(AppInterface $adapter) |
||
| 52 | { |
||
| 53 | $this->adapter = $adapter; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $baseDir |
||
| 58 | */ |
||
| 59 | public static function setBaseDir(string $baseDir) |
||
| 60 | { |
||
| 61 | self::$baseDir = $baseDir; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public static function getBaseDir(): string |
||
| 68 | { |
||
| 69 | return self::$baseDir; |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return AppInterface |
||
| 74 | */ |
||
| 75 | public function getAdapter(): AppInterface |
||
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @param string $method |
||
| 82 | * @param array|null $arguments |
||
| 83 | * @return mixed |
||
| 84 | * @throws BaseException |
||
| 85 | */ |
||
| 86 | public function __call(string $method, ?array $arguments) |
||
| 93 | } |
||
| 94 | } |