Skip to content

Commit c53daca

Browse files
Fix StaticConstructorLoader decorator (#20)
1 parent 02927ba commit c53daca

File tree

1 file changed

+116
-2
lines changed

1 file changed

+116
-2
lines changed

src/StaticConstructorLoader/StaticConstructorLoader.php

Lines changed: 116 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @author Dmitrijs Balabka <dmitry.balabka@gmail.com>
1414
*/
15-
final class StaticConstructorLoader
15+
final class StaticConstructorLoader extends ClassLoader /* extending for an contract */
1616
{
1717
/**
1818
* @var ClassLoader
@@ -53,12 +53,126 @@ public function __construct(ClassLoader $classLoader)
5353
array_map('spl_autoload_register', $loadersToRestore, $flagTrue, $flagTrue);
5454
}
5555

56-
public function loadClass(string $className): ?bool
56+
public function loadClass($className): ?bool
5757
{
5858
$result = $this->classLoader->loadClass($className);
5959
if ($result === true && $className !== StaticConstructorInterface::class && is_a($className, StaticConstructorInterface::class, true)) {
6060
$className::__constructStatic();
6161
}
6262
return $result;
6363
}
64+
65+
/** @codeCoverageIgnore */
66+
public function getPrefixes()
67+
{
68+
return $this->classLoader->getPrefixes();
69+
}
70+
71+
/** @codeCoverageIgnore */
72+
public function getPrefixesPsr4()
73+
{
74+
return $this->classLoader->getPrefixesPsr4();
75+
}
76+
77+
/** @codeCoverageIgnore */
78+
public function getFallbackDirs()
79+
{
80+
return $this->classLoader->getFallbackDirs();
81+
}
82+
83+
/** @codeCoverageIgnore */
84+
public function getFallbackDirsPsr4()
85+
{
86+
return $this->classLoader->getFallbackDirsPsr4();
87+
}
88+
89+
/** @codeCoverageIgnore */
90+
public function getClassMap()
91+
{
92+
return $this->classLoader->getClassMap();
93+
}
94+
95+
/** @codeCoverageIgnore */
96+
public function addClassMap(array $classMap)
97+
{
98+
$this->classLoader->addClassMap($classMap);
99+
}
100+
101+
/** @codeCoverageIgnore */
102+
public function add($prefix, $paths, $prepend = false)
103+
{
104+
$this->classLoader->add($prefix, $paths, $prepend);
105+
}
106+
107+
/** @codeCoverageIgnore */
108+
public function addPsr4($prefix, $paths, $prepend = false)
109+
{
110+
$this->classLoader->addPsr4($prefix, $paths, $prepend);
111+
}
112+
113+
/** @codeCoverageIgnore */
114+
public function set($prefix, $paths)
115+
{
116+
$this->classLoader->set($prefix, $paths);
117+
}
118+
119+
/** @codeCoverageIgnore */
120+
public function setPsr4($prefix, $paths)
121+
{
122+
$this->classLoader->setPsr4($prefix, $paths);
123+
}
124+
125+
/** @codeCoverageIgnore */
126+
public function setUseIncludePath($useIncludePath)
127+
{
128+
$this->classLoader->setUseIncludePath($useIncludePath);
129+
}
130+
131+
/** @codeCoverageIgnore */
132+
public function getUseIncludePath()
133+
{
134+
return $this->classLoader->getUseIncludePath();
135+
}
136+
137+
/** @codeCoverageIgnore */
138+
public function setClassMapAuthoritative($classMapAuthoritative)
139+
{
140+
$this->classLoader->setClassMapAuthoritative($classMapAuthoritative);
141+
}
142+
143+
/** @codeCoverageIgnore */
144+
public function isClassMapAuthoritative()
145+
{
146+
return $this->classLoader->isClassMapAuthoritative();
147+
}
148+
149+
/** @codeCoverageIgnore */
150+
public function setApcuPrefix($apcuPrefix)
151+
{
152+
$this->classLoader->setApcuPrefix($apcuPrefix);
153+
}
154+
155+
/** @codeCoverageIgnore */
156+
public function getApcuPrefix()
157+
{
158+
return $this->classLoader->getApcuPrefix();
159+
}
160+
161+
/** @codeCoverageIgnore */
162+
public function register($prepend = false)
163+
{
164+
$this->classLoader->register($prepend);
165+
}
166+
167+
/** @codeCoverageIgnore */
168+
public function unregister()
169+
{
170+
$this->classLoader->unregister();
171+
}
172+
173+
/** @codeCoverageIgnore */
174+
public function findFile($class)
175+
{
176+
return $this->classLoader->findFile($class);
177+
}
64178
}

0 commit comments

Comments
 (0)