|
12 | 12 | *
|
13 | 13 | * @author Dmitrijs Balabka <dmitry.balabka@gmail.com>
|
14 | 14 | */
|
15 |
| -final class StaticConstructorLoader |
| 15 | +final class StaticConstructorLoader extends ClassLoader /* extending for an contract */ |
16 | 16 | {
|
17 | 17 | /**
|
18 | 18 | * @var ClassLoader
|
@@ -53,12 +53,107 @@ public function __construct(ClassLoader $classLoader)
|
53 | 53 | array_map('spl_autoload_register', $loadersToRestore, $flagTrue, $flagTrue);
|
54 | 54 | }
|
55 | 55 |
|
56 |
| - public function loadClass(string $className): ?bool |
| 56 | + public function loadClass($className): ?bool |
57 | 57 | {
|
58 | 58 | $result = $this->classLoader->loadClass($className);
|
59 | 59 | if ($result === true && $className !== StaticConstructorInterface::class && is_a($className, StaticConstructorInterface::class, true)) {
|
60 | 60 | $className::__constructStatic();
|
61 | 61 | }
|
62 | 62 | return $result;
|
63 | 63 | }
|
| 64 | + |
| 65 | + public function getPrefixes() |
| 66 | + { |
| 67 | + return $this->classLoader->getPrefixes(); |
| 68 | + } |
| 69 | + |
| 70 | + public function getPrefixesPsr4() |
| 71 | + { |
| 72 | + return $this->classLoader->getPrefixesPsr4(); |
| 73 | + } |
| 74 | + |
| 75 | + public function getFallbackDirs() |
| 76 | + { |
| 77 | + return $this->classLoader->getFallbackDirs(); |
| 78 | + } |
| 79 | + |
| 80 | + public function getFallbackDirsPsr4() |
| 81 | + { |
| 82 | + return $this->classLoader->getFallbackDirsPsr4(); |
| 83 | + } |
| 84 | + |
| 85 | + public function getClassMap() |
| 86 | + { |
| 87 | + return $this->classLoader->getClassMap(); |
| 88 | + } |
| 89 | + |
| 90 | + public function addClassMap(array $classMap) |
| 91 | + { |
| 92 | + $this->classLoader->addClassMap($classMap); |
| 93 | + } |
| 94 | + |
| 95 | + public function add($prefix, $paths, $prepend = false) |
| 96 | + { |
| 97 | + $this->classLoader->add($prefix, $paths, $prepend); |
| 98 | + } |
| 99 | + |
| 100 | + public function addPsr4($prefix, $paths, $prepend = false) |
| 101 | + { |
| 102 | + $this->classLoader->addPsr4($prefix, $paths, $prepend); |
| 103 | + } |
| 104 | + |
| 105 | + public function set($prefix, $paths) |
| 106 | + { |
| 107 | + $this->classLoader->set($prefix, $paths); |
| 108 | + } |
| 109 | + |
| 110 | + public function setPsr4($prefix, $paths) |
| 111 | + { |
| 112 | + $this->classLoader->setPsr4($prefix, $paths); |
| 113 | + } |
| 114 | + |
| 115 | + public function setUseIncludePath($useIncludePath) |
| 116 | + { |
| 117 | + $this->classLoader->setUseIncludePath($useIncludePath); |
| 118 | + } |
| 119 | + |
| 120 | + public function getUseIncludePath() |
| 121 | + { |
| 122 | + return $this->classLoader->getUseIncludePath(); |
| 123 | + } |
| 124 | + |
| 125 | + public function setClassMapAuthoritative($classMapAuthoritative) |
| 126 | + { |
| 127 | + $this->classLoader->setClassMapAuthoritative($classMapAuthoritative); |
| 128 | + } |
| 129 | + |
| 130 | + public function isClassMapAuthoritative() |
| 131 | + { |
| 132 | + return $this->classLoader->isClassMapAuthoritative(); |
| 133 | + } |
| 134 | + |
| 135 | + public function setApcuPrefix($apcuPrefix) |
| 136 | + { |
| 137 | + $this->classLoader->setApcuPrefix($apcuPrefix); |
| 138 | + } |
| 139 | + |
| 140 | + public function getApcuPrefix() |
| 141 | + { |
| 142 | + return $this->classLoader->getApcuPrefix(); |
| 143 | + } |
| 144 | + |
| 145 | + public function register($prepend = false) |
| 146 | + { |
| 147 | + $this->classLoader->register($prepend); |
| 148 | + } |
| 149 | + |
| 150 | + public function unregister() |
| 151 | + { |
| 152 | + $this->classLoader->unregister(); |
| 153 | + } |
| 154 | + |
| 155 | + public function findFile($class) |
| 156 | + { |
| 157 | + return $this->classLoader->findFile($class); |
| 158 | + } |
64 | 159 | }
|
0 commit comments