-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathObject_.php
More file actions
112 lines (94 loc) Β· 2.3 KB
/
Object_.php
File metadata and controls
112 lines (94 loc) Β· 2.3 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
declare(strict_types=1);
namespace PHPJava\Packages\PHPJava\Extended;
use PHPJava\Core\JavaClass;
use PHPJava\Core\JVM\Parameters\Runtime;
use PHPJava\Packages\java\lang\CloneNotSupportedException;
use PHPJava\Packages\java\lang\NoSuchMethodException;
use PHPJava\Packages\PHPJava\Kernel\Behavior\System;
trait Object_
{
protected $parameters;
/**
* @var JavaClass
*/
protected $javaClass;
public function __construct(...$parameters)
{
$this->parameters = $parameters;
}
/**
* This method covers <clinit> processing on PHPJava.
*/
public static function __staticConstruct()
{
}
public function setJavaClass(JavaClass $javaClass): self
{
$this->javaClass = $javaClass;
return $this;
}
/**
* @throws NoSuchMethodException
*/
public function __destruct()
{
$this->finalize();
}
/**
* @throws NoSuchMethodException
*/
public function __call(string $name, array $arguments)
{
$defaultName = Runtime::PREFIX_DEFAULT . $name;
if (method_exists($this, $defaultName)) {
return $this->{$defaultName}(...$arguments);
}
throw new NoSuchMethodException($name . ' does not exist on ' . get_class($this));
}
public function __default_clone(): void
{
throw new CloneNotSupportedException();
}
public function __default_equals($a = null): bool
{
return $this === $a;
}
public function __default_getClass(): self
{
return $this;
}
public function __default_hashCode()
{
return System::identityHashCode($this);
}
public function __default_notify(): void
{
// not implemented.
}
public function __default_notifyAll(): void
{
// not implemented.
}
/**
* @return string
*/
public function __default_toString()
{
return 'java.lang.Object@PHPJava' . spl_object_hash($this);
}
/**
* @throws NoSuchMethodException
*/
public function __toString(): string
{
return $this->toString();
}
public function __default_wait(int $timeout = null, int $nanos = null): void
{
// not implemented.
}
public function __default_finalize(): void
{
}
}