File size: 712 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

declare(strict_types=1);

namespace Mautic\IntegrationsBundle\DTO;

final class Note
{
    public const TYPE_WARNING = 'warning';

    public const TYPE_INFO    = 'info';

    private string $type;

    public function __construct(
        private string $note,
        string $type
    ) {
        if (!in_array($type, [self::TYPE_INFO, self::TYPE_WARNING])) {
            throw new \InvalidArgumentException(sprintf('Type value can be either "%s" or "%s".', self::TYPE_INFO, self::TYPE_WARNING));
        }

        $this->type = $type;
    }

    public function getNote(): string
    {
        return $this->note;
    }

    public function getType(): string
    {
        return $this->type;
    }
}