type = self::TYPE; $this->uri = $uri; } /** * Creates an instance from an array. * * @param array{ * type: 'ref/resource', * uri: string * } $data * @phpstan-param array $data * @return self */ public static function fromArray(array $data): self { self::assertRequired($data, ['uri']); return new self( self::asString($data['uri']) ); } /** * Converts the instance to an array. * * @return array */ public function toArray(): array { $result = []; $result['type'] = $this->type; $result['uri'] = $this->uri; return $result; } /** * @return 'ref/resource' */ public function getType(): string { return $this->type; } /** * @return string */ public function getUri(): string { return $this->uri; } }