Lines 100.00% 2 / 2
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
MariaDbConnector 100.00% 2 / 2 100.00% 2 / 2 2 100.00% 1 / 1
 dialectLabel 100.00% 1 / 1 100.00% 1 / 1 1
 makeConnection 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace BlueprintAU\Radiant\Database\Connectors;
6
7use BlueprintAU\Radiant\Database\Connections\MariaDbConnection;
8use Pdo;
9use Override;
10
11/**
12 * MariaDB connector — builds a PDO MySQL connection from config, as the
13 * MySQL connector does.
14 *
15 * MariaDB speaks the MySQL wire protocol, so the DSN, charset allowlist
16 * and forced PDO options are inherited unchanged — only the connection
17 * class and the dialect label in the validation messages differ.
18 *
19 * @see \BlueprintAU\Radiant\Database\Connectors\MySqlConnector
20 *
21 * @phpstan-import-type PdoOptions from \BlueprintAU\Radiant\Database\Connectors\SqlConnector
22 */
23final class MariaDbConnector extends MySqlConnector
24{
25    /**
26     * The dialect's name in the connector's validation messages.
27     *
28     * @return string
29     */
30    #[Override]
31    protected function dialectLabel(): string
32    {
33        return 'MariaDB';
34    }
35
36    /**
37     * The connection class this connector builds.
38     *
39     * @param  \PDO  $pdo
40     * @return MariaDbConnection
41     */
42    #[Override]
43    protected function makeConnection(Pdo $pdo): MariaDbConnection
44    {
45        return new MariaDbConnection($pdo);
46    }
47}