path = $socketPath; } public function getPath(): string { return $this->path; } public function __serialize(): array { return [$this->path]; } public function __unserialize(array $serialized): void { $this->path = $serialized[0]; } public function equals(mixed $other): bool { return $other instanceof UnixEndPoint && $this->path === $other->path; } public static function parse(string $socketPath): UnixEndPoint { if(str_starts_with($socketPath, 'unix:')) { $uri = parse_url($socketPath); $socketPath = $uri['path'] ?? ''; } return new UnixEndPoint($socketPath); } public function __toString(): string { return $this->path; } }