-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathClassDeferredLoader.php
More file actions
49 lines (44 loc) · 1.38 KB
/
ClassDeferredLoader.php
File metadata and controls
49 lines (44 loc) · 1.38 KB
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
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Internal;
use PHPJava\Core\JavaClass;
use PHPJava\Core\JavaClassInterface;
use PHPJava\Exceptions\ClassDeferredLoaderException;
class ClassDeferredLoader
{
/**
* @throws \PHPJava\Exceptions\ReadEntryException
* @throws \PHPJava\Exceptions\UnknownVersionException
* @throws \PHPJava\Exceptions\ValidatorException
* @return array
*/
public function __debugInfo()
{
return ($this->initializeIfNotInitiated())->__debugInfo();
}
/**
* @throws \PHPJava\Exceptions\ReadEntryException
* @throws \PHPJava\Exceptions\UnknownVersionException
* @throws \PHPJava\Exceptions\ValidatorException
*/
public function __call(string $name, $arguments)
{
return ($this->initializeIfNotInitiated())->{$name}(...$arguments);
}
/**
* @throws \PHPJava\Exceptions\ReadEntryException
* @throws \PHPJava\Exceptions\UnknownVersionException
* @throws \PHPJava\Exceptions\ValidatorException
*/
public function __invoke(...$arguments): JavaClassInterface
{
return ($this->initializeIfNotInitiated())(...$arguments);
}
/**
* @throws ClassDeferredLoaderException
*/
protected function initializeIfNotInitiated(): JavaClass
{
throw new ClassDeferredLoaderException('Failed to load a non-specified class.');
}
}