1<?php
2
3/**
4 * This file is part of the FreeDSx SASL package.
5 *
6 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace FreeDSx\Sasl\Factory;
13
14use FreeDSx\Sasl\Exception\SaslException;
15use FreeDSx\Sasl\Message;
16
17/**
18 * Used to instantiate messages of a specific type for a mechanism.
19 *
20 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
21 */
22interface MessageFactoryInterface
23{
24    /**
25     * Create a message object of a specific type for a given mechanism.
26     *
27     * @param int $type
28     * @param array $options
29     * @param Message|null $received
30     * @return Message
31     * @throws SaslException
32     */
33    public function create(int $type, array $options = [], ?Message $received = null): Message;
34}
35