Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Mail\Domain\Contract;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11/**
12 * Protocol Driver Registry Contract.
13 *
14 * Resolves appropriate mail protocol driver instance by protocol key ('imap', 'jmap', 'exchange').
15 *
16 * @package App\Modules\Mail\Domain\Contract
17 */
18interface MailProtocolDriverRegistryInterface
19{
20    /**
21     * Resolves driver instance for given protocol code.
22     *
23     * @param string $protocolType Protocol type ('imap', 'jmap', 'exchange').
24     * @return MailProtocolDriverInterface Driver instance.
25     */
26    public function getDriver(string $protocolType): MailProtocolDriverInterface;
27
28    /**
29     * Checks if driver is registered for protocol.
30     *
31     * @param string $protocolType Protocol type.
32     * @return bool True if supported.
33     */
34    public function supports(string $protocolType): bool;
35
36    /**
37     * Registers a driver instance for protocol.
38     *
39     * @param string                     $protocolType Protocol type.
40     * @param MailProtocolDriverInterface $driver       Driver instance.
41     */
42    public function registerDriver(string $protocolType, MailProtocolDriverInterface $driver): void;
43}