Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
namespace Packback\Lti1p3\DeepLinkResources;
4
 
5
use Packback\Lti1p3\Concerns\Arrayable;
6
 
7
class Icon
8
{
9
    use Arrayable, HasDimensions;
10
 
11
    public function __construct(
12
        private string $url,
13
        private int $width,
14
        private int $height
15
    ) {
16
    }
17
 
18
    public static function new(string $url, int $width, int $height): self
19
    {
20
        return new Icon($url, $width, $height);
21
    }
22
 
23
    public function getArray(): array
24
    {
25
        return [
26
            'url' => $this->url,
27
            'width' => $this->width,
28
            'height' => $this->height,
29
        ];
30
    }
31
 
32
    public function setUrl(string $url): self
33
    {
34
        $this->url = $url;
35
 
36
        return $this;
37
    }
38
 
39
    public function getUrl(): string
40
    {
41
        return $this->url;
42
    }
43
}