This repository was archived by the owner on Feb 17, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLink.php
More file actions
71 lines (58 loc) · 1.41 KB
/
Link.php
File metadata and controls
71 lines (58 loc) · 1.41 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
<?php
declare(strict_types=1);
namespace ReactParallel\ObjectProxy\Message;
final class Link implements Message
{
private string $hash;
private string $objectHash;
private string $method;
/** @var mixed[] */
private array $args;
private ?object $link;
/**
* @param mixed[] $args
*/
public function __construct(string $hash, string $objectHash, string $method, array $args, ?Link $link)
{
$this->hash = $hash;
$this->objectHash = $objectHash;
$this->method = $method;
$this->args = $args;
$this->link = $link;
}
public function hash(): string
{
return $this->hash;
}
public function rootHash(): string
{
return $this->link instanceof Link ? $this->link->rootHash() : $this->hash;
}
public function objectHash(): string
{
return $this->objectHash;
}
public function method(): string
{
return $this->method;
}
/**
* @return mixed[]
*/
public function args(): array
{
return $this->args;
}
/**
* @psalm-suppress MoreSpecificReturnType
*/
public function link(): ?Link
{
/**
* Have to do this because ext-parallel blows if we set the use Link as typed property
*
* @psalm-suppress LessSpecificReturnStatement
*/
return $this->link;
}
}