1: <?php
2:
3: declare(strict_types = 1);
4:
5: namespace CloudCastle\FileSystem;
6:
7: /**
8: * Класс FileSystem
9: * @version 0.0.1
10: * @package CloudCastle\FileSystem
11: * @generated Зорин Алексей, please DO NOT EDIT!
12: * @author Зорин Алексей <zorinalexey59292@gmail.com>
13: * @copyright 2022 разработчик Зорин Алексей Евгеньевич.
14: */
15: class FileSystem
16: {
17:
18: public ?File $file;
19: public ?Dir $dir;
20: public ?Json $json;
21: protected static array $obj = [];
22:
23: /**
24: * Конструктор класса
25: */
26: protected function __construct()
27: {
28: $this->dir = new Dir();
29: $this->file = new File();
30: $this->json = new Json();
31: }
32:
33: /**
34: * Получить текущий объект текущего класса
35: * @return $this
36: */
37: public static function instance(): self
38: {
39: $class = get_called_class();
40: if ( ! isset(self::$obj[$class])) {
41: self::$obj[$class] = new self();
42: }
43: return self::$obj[$class];
44: }
45:
46: }
47: