1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace App\Libraries\Opengraph;
9
10use App\Models\Artist;
11
12class ArtistOpengraph implements OpengraphInterface
13{
14 public function __construct(private Artist $artist)
15 {
16 }
17
18 public function get(): array
19 {
20 return [
21 'description' => first_paragraph(markdown_plain($this->artist->description)),
22 'image' => $this->artist->cover_url,
23 'title' => $this->artist->name,
24 ];
25 }
26}