url = $url; $this->width = $width; } /** * @param array{url: string, width: int} $attributes */ public static function from( array $attributes ): self { return new self( $attributes['url'], $attributes['width'] ); } /** * @return array{url: string, width: int} */ public function toArray(): array { return [ 'url' => $this->url, 'width' => $this->width, ]; } }